Can I upgrade a plugin to a specific version?

Using WP-CLI you can specify this as described in the official documentation. $ wp plugin update <plugin> Using either of the following arguments –minor Only perform updates for minor releases (e.g. from 1.3 to 1.4 instead of 2.0) –patch Only perform updates for patch releases (e.g. from 1.3 to 1.3.3 instead of 1.4) –version=<version> If … Read more

How do i know the current post type when on post.php in admin?

add_action( ‘admin_init’, ‘do_something_152677’ ); function do_something_152677 () { // Global object containing current admin page global $pagenow; // If current page is post.php and post isset than query for its post type // if the post type is ‘event’ do something if ( ‘post.php’ === $pagenow && isset($_GET[‘post’]) && ‘post’ === get_post_type( $_GET[‘post’] ) ) … Read more

How to customize woocommerce related products? [closed]

Firstly, you can’t immediately achieve the goal you described with the code you show in your question. To understand why there isn’t a direct approach with that code you have to take a look at what you’re using – woocommerce_related_products() – to do what you have done so far. Secondly, you have to understand, because … Read more

How to add field for new site-wide option on Network Settings screen?

There’s a wpmu_options action that lets you append more HTML on the Network Settings page. If you want to add your own sub-menu/page to the Settings parent menu: add_action(‘network_admin_menu’, ‘add_my_netw_settings_page’); function add_my_netw_settings_page() { add_submenu_page( ‘settings.php’, ‘Co za asy’, ‘Co za asy’, ‘manage_network_options’, ‘my-netw-settings’, ‘your_form’ ); } function your_form(){ $options = get_site_option(‘your_plugin’); ?> <form action=”<?php echo … Read more

What are the common security flaws I need to look for? [closed]

Here is a modified checklist, based on my current (work-in-progress) settings/data security checklist used for reviewing Themes (the principles should be no different for Plugins than they are for Themes): Plugins should prefix all options, custom functions, custom variables, and custom constants with plugin-slug. Plugins should implement Plugin Options and Plugin Settings pages deliberately, rather … Read more

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