Plugin prevents an unrelated function working
-
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)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Plugin prevents an unrelated function working’ is closed to new replies.