custom-functionality-plugin-example icon indicating copy to clipboard operation
custom-functionality-plugin-example copied to clipboard

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

Open Colinsp opened this issue 11 years ago • 4 comments

/** 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 );

Colinsp avatar Jun 27 '14 05:06 Colinsp

This is great. Definitely will pull this into the plugin

DevinWalker avatar Jun 28 '14 21:06 DevinWalker

Would you mind submitting a pull request?

DevinWalker avatar Jun 28 '14 21:06 DevinWalker

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

Colinsp avatar Jun 29 '14 04:06 Colinsp

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

Colinsp avatar Jun 29 '14 06:06 Colinsp