• hi, I just tried your plugin, seems like the allowed tags function not working any more. sse the code below plz:

    add_filter( ‘admin_init’, ‘allowed_tags’ );
    function allowed_tags() {
    global $allowedposttags;
    $allowedposttags[‘video’][‘src’] = array();
    $allowedposttags[‘video’][‘type’] = array();
    $allowedposttags[‘video’][‘poster’] = array();
    }

    when i save into functions.php, the wordpress back-end become blank. When I turn on the WP_DEBUG, it shows:

    Fatal error: Cannot redeclare allowed_tags() (previously declared in /Applications/MAMP/htdocs/artwise/wp-includes/general-template.php:1359) in /Applications/MAMP/htdocs/artwise/wp-content/themes/artwise/functions.php on line 974

    plz advise.

    https://wordpress.org/plugins/post-editor-buttons-fork/

Viewing 1 replies (of 1 total)
  • Plugin Author Kailey (trepmal)

    (@trepmal)

    You seem to have come across a silly bug that no one ha alerted me to yet. In my sample code, I use the function name allowed_tags which, as the error message suggests, is already declared.

    Simply changing that function name (as well as in the callback) should alleviate the problem.

    add_filter( 'admin_init', 'prefix_allowed_tags' );
    function prefix_allowed_tags() {
    	global $allowedposttags;
    	$allowedposttags['video']['src'] = array();
    	$allowedposttags['video']['type'] = array();
    	$allowedposttags['video']['poster'] = array();
    }

    Go ahead and change prefix_ to anything that makes more sense for your plugin/theme.

Viewing 1 replies (of 1 total)
  • The topic ‘allowed_tags function not working anymore.’ is closed to new replies.