How to delete all trashed item in one-go
You can use, in your wp-config.php: define(‘EMPTY_TRASH_DAYS’, 2 ); The example above will delete trashed posts (of all types) after 2 days.
You can use, in your wp-config.php: define(‘EMPTY_TRASH_DAYS’, 2 ); The example above will delete trashed posts (of all types) after 2 days.
WordPress is not magic. If you add and action hook (register_activation_hook just add an action hook) to WordPress be able to read and run it, have to load your main plugin file, it can’t guess its content. And if WordPress load your main plugin file, it will load all the functions defined there (or in … Read more
Well, do_action() is in plugin.php for a reason. It’s intended for use by plugins, just like apply_filters(). This function is not the cause, it is just the middleman. It’s like saying your pizza tastes bad because of the delivery guy – instead of the restaurant itself. This is almost certainly caused by a plugin. I … Read more
You can do this by not including “editor” in the “supports” argument. And then add a new meta box using add_meta_box() in whose call back you can add all the post meta’s as required.
Grid of customer logos that link to their respective websites/success case posts. The site owner should be able to add or remove these at ease. Well I think the easiest way would to create a Custom Post Type called “Customer Logos”. After that you could handle content and images multiple ways: More Precise Control but … Read more
You can do this two way.But I prefer to go for the second way.You need to put this code in your plugins file. First way: function my_loginlcustomization() { echo ‘<style type=”text/css”> h1 a { background-image: url(‘ . plugin_dir_url( __FILE__ ).’/login/logo.png) !important; } </style>’; } add_action(‘login_head’, ‘my_loginlcustomization’); Second Way(I prefer): function my_loginlcustomization() { wp_register_style(‘custom_loginstyle’, plugins_url(‘/css/login.css’, __FILE__)); … Read more
Thanks to diggy from StackOverflow I’ve foudn that in the WordPress cycle, the file vars.php (containing my needed functions) is included after muplugins_loaded executes. Including wp_is_mobile() and current_user_can() in wrapper functions fixed my problem. CORRECT function my_epic_function() { if(current_user_can( ‘edit_posts’ )) { if(!wp_is_mobile()) { //code to be executed } } } add_action(‘init’, ‘my_epic_function’); INCORRECT function … Read more
You are getting this error because ‘wpmyfirstplugin_createTable’ is called on register_activation_hook. This hook is called when a plugin is activated from dashboard and before declaring any variable. So when this function runs it does not get the table name parameter.
The add_submenu_page first parameter should be the top menu page handle which in you case is a-qoute so: function a_qoute_admin_action(){ add_menu_page( __(‘Reservations Pages’),// the page title __(‘Donation’),//menu title ‘edit_themes’,//capability ‘a-qoute’,//menu slug/handle this is what you need!!! ‘qoute_settings’,//callback function ”,//icon_url, ”//position ); add_submenu_page( ‘a-qoute’, ‘Donations Log’, //page title ‘Donations Log’, //menu title ‘edit_themes’, //capability, ‘DonationsLog’,//menu slug … Read more
As you have already understated, running executable PHP inside a text box is not a good idea. It isn’t only just not a good idea, but a terrible idea. This creates a loop hole in your security which can be very easily exploited by a hacker. I would suggest writing your own custom widget for … Read more