How to make simply “report” button on posts

Basically, you filter ‘the_content’ and add a button. Okay, it might be slightly more complicated: You need to send a mail per wp_mail(). You need some spam protection: a hidden text field which should stay blank and a nonce field. You may want to restrict the pages where the button form will be displayed: On … Read more

Redirect to settings page after install

Register an activation hook and then redirect the user’s browser when you’re done installing your plugin. function myplugin_activate() { // TODO: Install your plugin here. // I don’t know of any other redirect function, so this’ll have to do. wp_redirect(admin_url(‘options-general.php?page=myplugin_settings’)); // You could use a header(sprintf(‘Location: %s’, admin_url(…)); here instead too. } register_activation_hook(__FILE__, ‘myplugin_activate’);

how to include other plugins css files in a shortcode?

I think you could get around this by pre-running the shortcodes on the page by applying the content filters before the header is output. This should allow any internal shortcodes run inside the included post to add any action hooks properly and thus any needed stylesheets/resources. add_action(‘wp_loaded’,’maybe_prerun_shortcodes’); function maybe_prerun_shortcodes() { if (is_page()) { global $post; … Read more

Use a plugin to handle custom post types?

Hi @Grant Palin: The register_post_type() function is really agnostic to theme or plugin; you can use it in an ‘init’ hook in either place, it really depends on what you are trying to accomplish. For example, if I’m setting up a custom site for a specific client I’ll probably just register the post types in … Read more

Show Woocommerce minicart widget in checkout page sidebar? And, how to make this update secure by overriding widget?

The cart widget isn’t showing because it’s configured to not show on the cart and checkout page. If you want to change that take a look at class-wc-widget-cart.php, there you find the following line: if ( is_cart() || is_checkout() ) return; Change it to: if ( is_cart() ) return; To show the widget on the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)