• Resolved luckybear23

    (@luckybear23)


    How to automatically use the zoom function instead of manually to click the image in wp editor and then click the zoom button.

    like every time someone post something within front-end submission , the post image is using the zoom function automatically

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author SilkyPress

    (@diana_burduja)

    You can try adding the following PHP snippet to the theme’s functions.php file:

    function zoooom_filter_post_class( $classes ) {
        $my_post_class = 'zoooom';
        $classes[] = $my_post_class;
        return $classes;
    }
    add_filter( 'post_class', 'zoooom_filter_post_class' );

    Note that if you add the zoom automatically to all the posts images, then there is no way to exclude some of the images.

    • This reply was modified 8 years, 10 months ago by SilkyPress.
    Thread Starter luckybear23

    (@luckybear23)

    It works but only on the front page , before using this code , the manual method make the zoom available only to post page.

    I have tried to change a bit the code to

    function zoooom_filter_post_class( $classes ) {
        $my_page_class = 'zoooom';
        $classes[] = $my_page_class;
        return $classes;
    }
    add_filter( 'post_class', 'zoooom_filter_post_class' );

    But it apply to all pages which make my website unusable on mobile mode

    Here is the link to my site

    *Note that i have turn off the code and using the manual method

    Thread Starter luckybear23

    (@luckybear23)

    And what i really need is just to have the zoom button ticked automatically when a user submit a post rather than i need to manually tick it

    Plugin Author SilkyPress

    (@diana_burduja)

    The plugin is open-source software to be used “as it is”. You want a feature that is specific for your website. I’m afraid you’ll have to ask a developer to do some custom work for you.

    Thread Starter luckybear23

    (@luckybear23)

    Is there any way to exclude a page from having zoom effect by using your code?

    Thread Starter luckybear23

    (@luckybear23)

    I lookup to your plugin admin.php, and i found

    /**
         * Add a button to the TinyMCE toolbar
         * @access public
         */
        function iz_add_tinymce_button() {
            global $typenow;
    
            if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) {
                return;
            }
    
            $allowed_types = array( 'post', 'page' );
    
            if ( defined('LEARNDASH_VERSION') ) {
                $learndash_types = array( 'sfwd-courses', 'sfwd-lessons', 'sfwd-topic', 'sfwd-quiz', 'sfwd-certificates', 'sfwd-assignment'); 
                $allowed_types = array_merge( $allowed_types, $learndash_types );
    
            }
            /*
            if( ! in_array( $typenow, $allowed_types ) )
                return;
             */
    
            if ( isset( $_GET['page'] ) && $_GET['page'] == 'wplister-templates' ) 
                return;
    
            if ( get_user_option('rich_editing') != 'true') 
                return;
    
            add_filter('mce_external_plugins', array( $this, 'iz_add_tinymce_plugin' ) );
            add_filter('mce_buttons', array( $this, 'iz_register_tinymce_button' ) );
        }
    
        /**
         * Register the plugin with the TinyMCE plugins manager
         * @access public
         */
        function iz_add_tinymce_plugin($plugin_array) {
            $plugin_array['image_zoom_button'] = IMAGE_ZOOM_URL . 'assets/js/tinyMCE-button.js'; 
            return $plugin_array;
        }
    
        /**
         * Register the button with the TinyMCE manager
         */
        function iz_register_tinymce_button($buttons) {
            array_push($buttons, 'image_zoom_button');
            return $buttons;
        }
    
    }

    there is setting that you make the function trigger when user click the button which i think

     /**
         * Register the button with the TinyMCE manager
         */
        function iz_register_tinymce_button($buttons) {
            array_push($buttons, 'image_zoom_button');
            return $buttons;
        }
    
    }

    Can you check this out?

    Plugin Author SilkyPress

    (@diana_burduja)

    The plugin is used on 10.000+ websites. Imagine how angry will be these websites’ owners when they see that there is a zoom on all their images. The feature you’re asking for has no place in this plugin.

    This is open source plugin and you need to take it “as it is”. If there is a bug with the plugin I’m happy to solve it. If there is a feature that makes sense for the plugin I might consider to implement it. For this feature I would recommend you to hire a developer to implement it for you.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Auto zoom in post’ is closed to new replies.