Force download a file within plugin file
Force download a file within plugin file
Force download a file within plugin file
The order in which any plugins are loaded is not guaranteed and should not be relied upon. Instead, if you have processes which should happen after the plugins are loaded, then you should put those inside a function and then connect that function to the plugins_loaded action hook.
I striked for something a bit more complex, but similar in the core. The rather old-ish Role Scoper can do that, or you try the Premium version of its successor Press Permit. I befind both a bit complex if you only need a single usage option (manage page restrictions), but they work ;). Hope this … Read more
How to add submenu to WordPress plugin in the same Directory of main Plugin?
You need to check that you aren’t already on the mobile site: function redirecting_to_mobile_site() { if ( $_SERVER[‘SERVER_NAME’] !== ‘m.example.com’ && wp_is_mobile() ) { wp_redirect( ‘http://m.example.com’ . $_SERVER[‘REQUEST_URI’], 301 ); exit; } } add_action( ‘template_redirect’, ‘redirecting_to_mobile_site’ ); You’ll need to clear your browser cache to properly test the fix.
The path of the plugins directory might have been changed. To be sure, you can double check the WP_PLUGIN_DIR constant. For example: print_r( WP_PLUGIN_DIR );
What is a good way to test that plugin upgrades have completed properly?
Page doesn’t load
If you have followed the code of the recent page widget then what you are trying to achieve can’t be done as naively as you are trying to do it. Recent posts widget caching is based on the assumption that the same output is displayed everywhere which is why it can calculate the cache on … Read more
Drop this into the file that is displaying the date (assuming you are using get_the_date): $month = date( ‘F’ ); $categoryIds = array(); $bannedMonth=”September”; $bannedCategory = 13; $categoryArray = get_the_category(); foreach ( $categoryArray as $categoryObj ) { array_push( $categoryIds, $categoryObj->term_id ); } if ( $month != $bannedMonth && !in_array( $bannedCategory, $categoryIds ) ) { echo … Read more