This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'testimonials_widget_meta_box', 'my_meta_box' ); | |
| function my_meta_box( $fields ) { | |
| $read_more_link = array( | |
| 'name' => __( 'Read More Link', 'testimonials-widget-premium' ), | |
| 'id' => 'testimonials-widget-read-more-link', | |
| 'type' => 'text', | |
| 'desc' => __( 'Alternate destination for "Read more" link. Leave blank for normal linking to full testimonial.', 'testimonials-widget-premium' ), | |
| ); | |
| $fields[] = $read_more_link; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'testimonials_widget_posts_custom_column', array( &$this, 'posts_custom_column' ), 10, 3 ); | |
| public function posts_custom_column( $result, $column, $post_id ) { | |
| switch ( $column ) { | |
| case 'testimonials-widget-read-more-link': | |
| $url = get_post_meta( $post_id, $column, true ); | |
| if ( ! empty( $url ) && 0 === preg_match( '#https?://#', $url ) ) { | |
| $url = 'http://' . $url; | |
| } | |
| $result = make_clickable( $url ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'testimonials_widget_query_args', array( &$this, 'query_args' ), 10, 2 ); | |
| public function query_args( $args, $atts ) { | |
| global $wpdb; | |
| $args['post_type'] = $atts['post_type']; | |
| $no_cache = $atts['no_cache']; | |
| if ( $no_cache ) { | |
| $args['no_cache'] = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'testimonials_widget_sections', 'sections' ); | |
| add_filter( 'testimonials_widget_settings', 'settings' ); | |
| public function sections( $sections ) { | |
| $sections[ 'premium' ] = __( 'Premium', 'testimonials-widget-premium' ); | |
| return $sections; | |
| } | |
| public function settings( $settings ) { | |
| $settings['premium_expand_begin'] = array( | |
| 'section' => 'premium', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'testimonials_widget_validate_settings', array( &$this, 'validate_settings' ), 10, 2 ); | |
| public static function validate_settings( $input, $errors = array(), $do_errors = false ) { | |
| if ( ! empty( $input['clearcache'] ) ) { | |
| Testimonials_Widget_Premium_Cache::clear_cache_all(); | |
| unset( $input['clearcache'] ); | |
| } | |
| if ( empty( $do_errors ) ) { | |
| $validated = $input; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'testimonials_widget_version', array( &$this, 'version' ) ); | |
| public function version( $version ) { | |
| $version .= '-' . self::PLUGIN_SLUG . '-' . self::VERSION; | |
| return $version; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'testimonials_widget_widget_options', array( &$this, 'widget_options' ) ); | |
| public function widget_options( $options ) { | |
| foreach ( $options as $id => $parts ) { | |
| if ( 'form' == $parts['section'] ) | |
| unset( $options[ $id ] ); | |
| } | |
| return $options; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'custom_bulkquick_edit_settings_as_types', 'settings_as_types' ); | |
| public function settings_as_types( $as_types ) { | |
| $as_types['date'] = esc_html__( 'As date' ); | |
| return $as_types; | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'custom_bulkquick_edit_settings_display_setting', 'display_setting', 10, 2 ); | |
| public function display_setting( $args, $input ) { | |
| $content = ''; | |
| extract( $args ); | |
| if ( is_null( $input ) ) { | |
| $options = get_option( self::ID ); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'custom_bulkquick_edit_manage_posts_custom_column_field_type', 'manage_posts_custom_column_field_type', 10, 4 ); | |
| public function manage_posts_custom_column_field_type( $current, $field_type, $column, $post_id ) { | |
| $result = ''; | |
| switch ( $field_type ) { | |
| case 'date': | |
| $result = $current; | |
| break; | |
| } |