• Resolved shaunbowen

    (@shaunbowen)


    Hi there, love the plugin but it does have an odd effect on some code I regularly use in my functions.php file. The following code allows a child page to automatically change its page template to match that of its parent, upon saving:

    //Change Page template to Parent type
    add_action('save_post','changeTemplateOnSave');
    if ( ! function_exists( 'changeTemplateOnSave' ) ) {
        function changeTemplateOnSave() {
            global $post;
            if ($post) {
                $curr_tmp = get_post_meta( $post->ID, '_wp_page_template', true );
                if ( $post->post_parent ) {
                    $parent_tmp = get_post_meta( $post->post_parent, '_wp_page_template', true );
                    update_post_meta( $post->ID, '_wp_page_template', $parent_tmp, $curr_tmp );
                }
            }
        }
    }
    

    For some reason, the above code only works if I deactivate the Strong Testimonials plugin! Do you know if there is a fix?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Chris Dillon

    (@cdillon27)

    Hi,

    Your code is working for me on a test site with a simple theme and a few plugins, with both Strong activated and deactivated.

    Are you able to test your code with Strong Testimonials activated and all other plugins deactivated?

    Plugin Contributor Chris Dillon

    (@cdillon27)

    Any news on this?

    Thread Starter shaunbowen

    (@shaunbowen)

    Hi Chris, sorry about that, I just haven’t had time to test this with the other work I’ve had on. I have it on my to-do list.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin prevents an unrelated function working’ is closed to new replies.