Post Content Shortcode Class Override
-
Hi
i’m trying to add a new parameter to the ‘post-content-shortcodes-title’ filter.At the end of the function function post_content( $atts=array()), i had the PHP code :
/* MODIF MANU */ $icon_class = get_post_meta($id,'icon_class'); //My new parameter if ( $show_title ) $content = apply_filters( 'post-content-shortcodes-title', '<h2>' . $p->post_title . '</h2>', $p->post_title, $icon_class ) . $content; /* FIN MODIF MANU */Then i can with a custom filter in my functions.php
add_filter( 'post-content-shortcodes-title', 'alter_pcs_title', 10, 3 ); function alter_pcs_title( $html, $title, $icon_class_array) { $icon_class = $icon_class_array[0]; return '<h2 class="widget-title"><span></span><span data-icon="'.$icon_class.'"></span>' . $title . '</h2>'; }But it’s not a good solution for upgrade, and i prefer to override this method.
Thanks in advance
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Post Content Shortcode Class Override’ is closed to new replies.