*/ class ALPRT_testimonials_Public { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ private $version; /** * Initialize the class and set its properties. * * @since 1.0.0 * @param string $plugin_name The name of the plugin. * @param string $version The version of this plugin. */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; } /** * Register the stylesheets for the public-facing side of the site. * * @since 1.0.0 */ public function alprt_enqueue_styles() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in ALPRT_testimonials_Loader as all of the hooks are defined * in that particular class. * * The ALPRT_testimonials_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ wp_enqueue_style( 'alprt-testifonts', 'https://fonts.googleapis.com/css?family=Raleway:300,400,500,600,700,800', array(), $this->version, 'all' ); wp_enqueue_style( 'alprt-testiawsome', plugin_dir_url( __FILE__ ) . 'css/font-awesome.css', array(), $this->version, 'all' ); wp_enqueue_style( 'alprt-public-css', plugin_dir_url( __FILE__ ) . 'css/alpharage-testimonials-public.css', array(), $this->version, 'all' ); } /** * Register the JavaScript for the public-facing side of the site. * * @since 1.0.0 */ public function alprt_enqueue_scripts() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in ALPRT_testimonials_Loader as all of the hooks are defined * in that particular class. * * The ALPRT_testimonials_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ wp_enqueue_script('jquery'); wp_enqueue_script('alprt-testiplugin', plugin_dir_url( __FILE__ ) . 'js/plugins.js', array( 'jquery' ), null, true ); wp_enqueue_script( 'alprt-public-js', plugin_dir_url( __FILE__ ) . 'js/alpharage-testimonials-public.js', array( 'jquery' ), null, true ); } public function alprt_image_size(){ add_image_size('wp_testi_thumb_1',90,90, true); add_image_size('wp_testi_thumb_2',100,100, true); add_image_size('wp_testi_thumb_3',31,31, true); add_image_size('wp_testi_thumb_4',140,140, true); add_image_size('wp_testi_thumb_5',44,44, true); add_image_size('wp_testi_thumb_6',35,35, true); } public function alprt_testimonial_css($backgroundcolor , $color , $bordercolor,$backgroundimage){ /** * This function is provided for Testimonials Dynamic Css. */ ?>
'; foreach ($wp_posts as $post) { $desig=get_post_meta( $post->ID, '_wp_testi_desig', true ); $alprt_html .= '
'.wp_get_attachment_image( get_post_thumbnail_id($post->ID), 'wp_testi_thumb_1').'
'.esc_attr($post->post_title).' '.esc_attr($desig).' '.esc_attr($post->post_content).'
'; } $alprt_html .= '
'; return $alprt_html; } public function alprt_testimonial_style2($wp_posts) { /** * This function is provided for Testimonials Style 2. */ $url= plugin_dir_url(dirname(__FILE__)); $alprt_html ='
'; foreach ($wp_posts as $post) { $desig=get_post_meta( $post->ID, '_wp_testi_desig', true ); $alprt_html .='
'.wp_get_attachment_image( get_post_thumbnail_id($post->ID), 'wp_testi_thumb_2').'
'.esc_attr($post->post_content).' '.esc_attr($post->post_title).'
'; } $alprt_html .='
'; return $alprt_html; } public function alprt_testimonial_style3($wp_posts) { /** * This function is provided for Testimonials Style 3. */ $alprt_html ='
'; foreach ($wp_posts as $post) { $desig=get_post_meta( $post->ID, '_wp_testi_desig', true ); $alprt_html .='

'.esc_attr(substr($post->post_content,0,200)).'...

'; } $alprt_html .='
'; return $alprt_html; } public function alprt_testimonial_style4($wp_posts) { /** * This function is provided for Testimonials Style 4. */ $alprt_html ='
'; foreach ($wp_posts as $post) { $desig=get_post_meta( $post->ID, '_wp_testi_desig', true ); $alprt_html .='
'.wp_get_attachment_image( get_post_thumbnail_id($post->ID), 'wp_testi_thumb_4').'
'.esc_attr($post->post_title).' '.esc_attr($desig).' '.esc_attr($post->post_content).'
'; } $alprt_html .='
'; return $alprt_html; } public function alprt_testimonial_style5($wp_posts) { /** * This function is provided for Testimonials Style 5. */ $alprt_html ='
'; foreach ($wp_posts as $post) { $desig=get_post_meta( $post->ID, '_wp_testi_desig', true ); $alprt_html .='
'.esc_attr(substr($post->post_content,0,100)).'
'.wp_get_attachment_image( get_post_thumbnail_id($post->ID), 'wp_testi_thumb_5').'
'.esc_attr($post->post_title).' '.esc_attr($desig).'
'; } $alprt_html .='
'; return $alprt_html; } public function alprt_testimonial_style6($wp_posts) { /** * This function is provided for Testimonials Style 6. */ $alprt_html ='
'; foreach ($wp_posts as $post) { $desig=get_post_meta( $post->ID, '_wp_testi_desig', true ); $alprt_html .='
'.wp_get_attachment_image( get_post_thumbnail_id($post->ID), 'wp_testi_thumb_6').'
'.esc_attr($post->post_title).' '.esc_attr($desig).'

'.esc_attr(substr($post->post_content,0,200)).'...

'; } $alprt_html .='
'; return $alprt_html; } }