Enhanced WordPress Search

It is somehow possible as you can phrase SQL queries to match your conditions but it will not perform very well as the MySQL table structure is not designed for this kind of full-text search. However, the solution requires more than just passing the search query (the user input) to the default WordPress s query … Read more

How to Move Local Singlesite Database to Remote Multsite Database?

Merging WordPress Standalone Installation with WordPress Multisite Installation Before You Begin: Create a new site in your Multisite Network, which will be the site you’re migrating from the Standalone installation. (Take note of the site ID #, you’ll need it later.) You need to make sure that all of the users from the Standalone installation, … Read more

Using table lock with wp_insert_post?

Firstly, your question indicates that your plugin sometimes runs over 5 min, don’t you get script timeouts? 5 min is a very long runtime… How many posts are you adding and what’s your server environment? Back to the problem… May I suggest another solution? Simply set an option that you’re doing something, and deactivate it … Read more

Get the timout value of a saved transient?

So, after one minute of more thinking, there is an easy solution, although i did not try it myself: $transient=”_transient_timeout_” . $_your_transient_name; $transient_timeout = get_option ( $transient ); you should be ready to go with this. Another Way throught the database would be: $transient=”_transient_timeout_” . $_your_transient_name; global $wpdb; $query = ‘SELECT option_value FROM ‘ . … Read more

What is the easiest way to implement cascading database upgrade for my plugin?

Ok, to resolve these issues, let’s implement the cascading upgrade process which will handle both use cases. First of all lets implement our plugin activation hook, which will be our entry point: // define current plugin version define( ‘WPSE8170_PLUGIN_VERSION’, ‘2.0.0’ ); // define our database table name define( ‘WPSE8170_DB_TABLE’, $GLOBALS[‘wpdb’]->prefix . ‘wpse8170_test_table’ ); add_action( ‘init’, … Read more

How do i export the HTML from text widgets?

The data in the options table is stored as serialized arrays. Use get_option() to get the data and unserialize them. array_walk( get_option( ‘widget_text’ ), function( $d ){ if ( ! empty( $d[‘title’] ) ) { printf( ‘<p>Title: %s<br>Text: %s</p>’, $d[‘title’], htmlentities( $d[‘text’] ) ); } } ); If you need a complete plugin, use this. … Read more

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