Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

some of my code snippets you may wish to consider for addition #4

Open

Description

@Colinsp

/** Execute PHP code in a standard text widget **/
add_filter('widget_text','execute_php',100);
function execute_php($html){
if(strpos($html,"<"."?php")!==false){
ob_start();
eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;
}

//Add buttons to the Editor
function add_more_buttons($buttons) {
$buttons[] = 'hr';
$buttons[] = 'del';
$buttons[] = 'sub';
$buttons[] = 'sup';
$buttons[] = 'anchor';
$buttons[] = 'fontselect';
$buttons[] = 'fontsizeselect';
$buttons[] = 'cleanup';
$buttons[] = 'styleselect';
return $buttons;
}
add_filter("mce_buttons_2", "add_more_buttons");

/*Execute a shortcode in a text widget */
add_filter('widget_text', 'do_shortcode');

//Turn on 'Kitchen Sink' for all users
function unhide_kitchensink( $args ) {
$args['wordpress_adv_hidden'] = false;
return $args;
}
add_filter( 'tiny_mce_before_init', 'unhide_kitchensink' );

//Remove Howdy
function replace_howdy( $wp_admin_bar ) {
$my_account=$wp_admin_bar->get_node('my-account');
$newtitle = str_replace( 'Howdy,', ' ', $my_account->title );
$wp_admin_bar->add_node( array(
'id' => 'my-account',
'title' => $newtitle,
) );
}
add_filter( 'admin_bar_menu', 'replace_howdy',25 );

Activity

  1. DevinWalker commented on Jun 28, 2014

    @DevinWalker
    Owner

    This is great. Definitely will pull this into the plugin

  2. DevinWalker commented on Jun 28, 2014

    @DevinWalker
    Owner

    Would you mind submitting a pull request?

  3. Colinsp commented on Jun 29, 2014

    @Colinsp
    Author

    Devin,
    I will have a go but I have never managed to get my head around how Git works.

  4. Colinsp commented on Jun 29, 2014

    @Colinsp
    Author

    Sorry still don't understand this programme. I have read the help and am none the wiser. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions