| 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( 'rtTPGFrontEnd' ) ):
class rtTPGFrontEnd {
function __construct() {
add_action( 'wp_enqueue_scripts', array( $this, 'rt_tpg_enqueue_styles' ) );
}
function rt_tpg_enqueue_styles() {
wp_enqueue_style( 'rt-tpg' );
global $rtTPG;
$settings = get_option( $rtTPG->options['settings'] );
$css = isset( $settings['custom_css'] ) ? trim( $settings['custom_css'] ) : null;
if ( $css ) {
wp_add_inline_style( 'rt-tpg', $css );
}
$scriptBefore = isset( $settings['script_before_item_load'] ) ? stripslashes( $settings['script_before_item_load'] ) : null;
$scriptAfter = isset( $settings['script_after_item_load'] ) ? stripslashes( $settings['script_after_item_load'] ) : null;
$scriptLoaded = isset( $settings['custom_script_loaded'] ) ? stripslashes( $settings['custom_script_loaded'] ) : null;
$script = "(function($){
$('.rt-tpg-container').on('tpg_item_before_load', function(){{$scriptBefore}});
$('.rt-tpg-container').on('tpg_item_after_load', function(){{$scriptAfter}});
$('.rt-tpg-container').on('tpg_loaded', function(){{$scriptLoaded}});
})(jQuery);";
wp_add_inline_script( 'rt-tpg', $script );
}
}
endif;