Custom media upload content for inserting custom post shortcode

Have a look at my guide here – http://www.wpexplorer.com/wordpress-tinymce-tweaks/ – so you can see how to create a popup window where you can select your options than insert a shortcode. If you download my Free Symple Shortcodes plugin you can see a live implementation as well. Instead of having the user select the posts to … Read more

Hooking in to plugins

@Ryan Elkins: I guess the answer depends on how import each use-case is to you. In some cases it would be something you need quick-and-dirty, in others it might be a more significant use-case. Here are the two things that come to mind: Look for Alternate Hooks within WordPress Core If it’s something quick and … Read more

Changing the “Plugin Activated” Message Default

You can try this: is_admin() && add_filter( ‘gettext’, function( $translated_text, $untranslated_text, $domain ) { $old = array( “Plugin <strong>activated</strong>.”, “Selected plugins <strong>activated</strong>.” ); $new = “Captain: The Core is stable and the Plugin is <strong>activated</strong> at full Warp speed”; if ( in_array( $untranslated_text, $old, true ) ) $translated_text = $new; return $translated_text; } , 99, … Read more

Woocommerce hook after creating order? [closed]

Try woocommerce_thankyou hook. This will trigger after recieving order successfully, no matter how user made payment. $hook_to = ‘woocommerce_thankyou’; $what_to_hook = ‘wl8OrderPlacedTriggerSomething’; $prioriy = 111; $num_of_arg = 1; add_action($hook_to, $what_to_hook, $prioriy, $num_of_arg); function wl8OrderPlacedTriggerSomething($order_id){ //do something… } For more reference dig into woocommerce/templates/checkout/thankyou.php

Create tabs inside Plugins Admin Page [closed]

I advice you to read this topic: Here you can find complete guide making options page with tabbed content. Or you can just copy the html of the tabbed page that you’ve liked, and use it on your own options page. I made my options page with tabs too, but with api. Tabs and the … Read more

How to use classes declared in another plugin?

You have to check if the class exists, but before that you have to wait that all plugin are loaded: no one can assure that your plugin is loaded after WooCommerce. For run a code from plugin when all plugin are loaded hook into plugins_loaded hook. Be aware that you cannot use this hook in … Read more

Check if add_menu_page exists or not

You can use the fourth parameter of add_menu_page(), the my_unique_slug, to check if the page exists: if ( empty ( $GLOBALS[‘admin_page_hooks’][‘my_unique_slug’] ) ) add_menu_page( ‘Page Title’, ‘Top Menu Title’, ‘manage_options’, ‘my_unique_slug’, ‘my_magic_function’ ); $GLOBALS[‘admin_page_hooks’] is the list of registered pages.

What is difference between get_bloginfo(‘url’) and get_site_url()?

get_bloginfo(‘url’) calls home_url() calls get_home_url() reads option home get_bloginfo(‘wpurl’) calls site_url() calls get_site_url() reads option siteurl get_bloginfo(‘siteurl’) and get_bloginfo(‘home’) are deprecated arguments and return get_bloginfo(‘url’) (siteurl argument is documented wrong in Codex as equal to wpurl, it’s not in current code) The difference is that these two function chain to different options, which are typically … Read more