Cron While Editing Post

It seems to have solved by changing the two functions, by taking a different approach: /* CHECK IF CURRENT USER IS NOT IN POST.PHP AND IN POST-NEW.PHP AND DOWNGRADE PUBLISH POSTS IN PENDING AFTER X DAYS */ if(is_admin() ) {global $pagenow; if( ‘post.php’ != $pagenow || ‘post-new.php’ != $pagenow) { add_action( ‘init’, ‘downgrade_publish_posts’ ); function …

Read more

Backticks (`) Instead of Single Quotes (‘) in an SQL Statement?

Backticks and regular quotes (both single and double) have distinct meanings in SQL. Quotes indicate a literal string, whereas backticks are quoted identifiers. This isn’t specific to WordPress, but rather a general way in SQL of quoting columns or tables. For example, imagine you’re running a query comparing two columns: SELECT * FROM wp_posts WHERE …

Read more

WordPress SQL LIKE request doesn’t work for fields with special symbols

What I miss here? How to search through any elements in this field? Your SQL statements, or the LIKE ‘%a%’ and LIKE ‘%full%’, are good. But the wpdb::prepare()‘s documentation says, “Literal percentage signs (%) in the query string must be written as %%“, hence you should actually use LIKE ‘%%a%%’ and LIKE ‘%%full%%’. But then …

Read more

How To Write An Inner Join With WP Query

Ok so the way I was able to just show English properties on the user admin page was with this posts_request hook: add_filter(‘posts_request’, function($sql, $query) { $is_user_edit_page = ( isset($_SERVER[‘HTTP_REFERER’]) && strpos($_SERVER[‘HTTP_REFERER’], ‘user-edit’) !== false ); $is_property_sql = (strpos($sql, ‘property’) !== false); if ($is_user_edit_page && $is_property_sql) { $sql = str_replace(“‘sp'”, “‘en'”, $sql); } return $sql; …

Read more

Moving database with phpMyAdmin

I would do this so. But this is probably not the most efficient way accomplishing this task. There are several plugins out there, that may automate this. If anyone knows one, that is good, I would like to hear about it. Plugins that look promising: http://wordpress.org/extend/plugins/xcloner-backup-and-restore/ http://wordpress.org/extend/plugins/duplicator/ http://wordpress.org/extend/plugins/wp-migrate-db/ Find more at: http://wordpress.org/extend/plugins/tags/backup

How do I move a WordPress site to another server?

I do this all the time to move a site from our staging server to the live domain. I use PHPMyAdmin to export the database as an SQL file, then open it up in a text editor and do a global find and replace on the old url to change it to the new url. …

Read more