| Server IP : 68.183.124.220 / Your IP : 216.73.217.137 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : 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, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/wp-content/plugins/the-post-grid/lib/classes/ |
Upload File : |
<?php
if(!class_exists('rtTPGSCButton')):
class rtTPGSCButton{
public $sc_tag = 'rt_tpg_scg';
function __construct() {
if ( is_admin() ){
add_action('admin_head', array( $this, 'admin_head') );
}
}
/**
* admin_head
* calls your functions into the correct filters
* @return void
*/
function admin_head() {
// check user permissions
if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
return;
}
// check if WYSIWYG is enabled
if ( 'true' == get_user_option( 'rich_editing' ) ) {
add_filter( 'mce_external_plugins', array( $this ,'mce_external_plugins' ) );
add_filter( 'mce_buttons', array($this, 'mce_buttons' ) );
global $rtTPG;
echo "<style>";
echo "i.mce-i-rt_tpg_scg{";
echo "background: url('".$rtTPG->assetsUrl ."images/rt-tpg-sc.png');";
echo "}";
echo "</style>";
}
}
/**
* mce_external_plugins
* Adds our tinymce plugin
* @param array $plugin_array
* @return array
*/
function mce_external_plugins( $plugin_array ) {
global $rtTPG;
$plugin_array[$this->sc_tag] = $rtTPG->assetsUrl .'js/mce-button.js';
return $plugin_array;
}
/**
* mce_buttons
* Adds our tinymce button
* @param array $buttons
* @return array
*/
function mce_buttons( $buttons ) {
array_push( $buttons, $this->sc_tag );
return $buttons;
}
}
endif;