| Server IP : 43.153.74.48 / Your IP : 216.73.216.175 Web Server : LiteSpeed System : Linux VM-0-13-ubuntu 5.15.0-113-generic #123-Ubuntu SMP Mon Jun 10 08:16:17 UTC 2024 x86_64 User : www ( 1002) PHP Version : 8.1.29 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/stainlesstint.com/wp-content/plugins/custom-codes/lib/ |
Upload File : |
<?php
/**
* Plugin activation actions.
*
* @since 2.0.0
* @package Custom_Codes
*/
defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
/**
* Create and give permission to the custom codes directory.
*/
function codes_plugin_activate() {
global $wp_filesystem;
if ( empty( $wp_filesystem ) ) {
include_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem();
}
// Create the folder.
if ( ! file_exists( CODES_FOLDER_DIR ) ) {
$wp_filesystem->mkdir( CODES_FOLDER_DIR, 0755 );
}
// Give permission.
if ( ! is_readable( CODES_FOLDER_DIR ) || ! codes_is_writable( CODES_FOLDER_DIR ) ) {
$wp_filesystem->chmod( CODES_FOLDER_DIR, 0755 );
}
}
register_activation_hook( CODES_FILE, 'codes_plugin_activate' );
/**
* Shortcut in the plugins page.
*
* @param array $actions Plugin action links array.
* @param array $file Returns plugin file name.
*/
function codes_plugins_page_link( $actions, $file ) {
if ( plugin_basename( CODES_FILE ) === $file ) {
$actions['settings'] = '<a href="' . admin_url( 'edit.php?post_type=custom-code&page=settings' ) . '">' . __( 'Settings', 'custom-codes' ) . '</a>';
}
return $actions;
}
add_filter( 'plugin_action_links', 'codes_plugins_page_link', 2, 2 );
/**
* Call the translation.
*/
function codes_load_plugin_textdomain() {
load_textdomain( 'custom-codes', CODES_PLUGIN_DIR . '/languages/custom-codes-' . get_user_locale() . '.mo' );
}
add_action( 'plugins_loaded', 'codes_load_plugin_textdomain' );