Tag Info

Hot answers tagged

3

You should not use this technique to change the URL of your site : WordPress sometimes stores URLs in serialized strings. You find/replace will corrupt the serialized data and discard the whole content. You can use interconnect/it search and replace tool to change the domain without any risk. This tool even allow you to run a dry test to check what will be ...


2

We determined that the slug was not stored in postmeta meta_key _wp_old_slug. In a final attempt to find where this slug is stored. I performed a search for the exact phrase of writing and found a few results. The one of interest was in wp_terms. I deleted that entry and then changed the slug of the category to /writing and it is working. The strange part ...


2

update_option() does this for you already: // If the new and old values are the same, no need to update. if ( $value === $old_value ) return false; No need to worry about it. :) Note that if you have a lot of options, which are not autoloaded, this might cause excessive read queries. This applies to general operation too, not just updates.


2

WordPress' terms and taxonomies are spread over three tables in the database. Those tables are wp_terms, wp_term_relationships and wp_term_taxonomy - see the codex article on Database Description for more details. The parent relationship is part of the wp_term_taxonomy table, so you should inspect the differences between your environments in this table. ...


1

Here are two possible solutions, both of these are actually generic MySQL version control tools but can be adapted to your workflow: dbv.php This tool creates "migrations", which are basically SQL scripts, from the changes detected on the database. These scripts are stored in a local directory and thus can be commited to your current VCS (git, for ...


1

I think you will require to custom develop some part of it but most of it can be done with Contact Form 7 plugin. You can create forms with upload fields very easily in Contact Form 7. And you can make it visible for loggenin users only like this. <?php if ( is_user_logged_in() ) { echo do_shortcode('[contact-form-7 id="91" title="Form"]'); ...


1

Have you tried $wpdb->replace. According to WP Codex: Replace a row in a table if it exists or insert a new row in a table if the row did not already exist. I have tried myself in some plugins and it does the work when trying to avoid unique IDs duplication errors, etc. More info in the codex


1

What WP does for arrays (and objects) on some contexts (such as post fields) is using maybe_serialize()/maybe_unserialize() to turn such types (and just them) to and from serialized (string-typed) representation. While this simplifies workflow it comes with penalties, such as being unable to properly query through such data and common issues with migration ...


1

In short, no. But it's not particularly complicated. Just add a new version_compare block each time you revise the database: $db_version = get_option( 'my_plugin_version' ); if ( version_compare( $db_version, '1.1', '<' ) ) { // Initial update code added in 1.1 } if ( version_compare( $db_version, '1.2', '<' ) ) { // Additional update code ...


1

I re-ran the following update and now my links work! update wp_posts set post_content = REPLACE(post_content, 'http://domain.com/wp', 'http://domain.com/blog');


1

Found a problem. Basically there were 2 options that forced my permalinks to https: Settings > General: change the site url from https to http. SEO by Yoast plugin, under section permalinks needed to change Canonical Settings to force HTTP.


1

It's in the table postmeta with the meta_key of _wp_old_slug If you wanted to clear all of the old slugs you could use this: DELETE FROM wp_postmeta WHERE meta_key = '_wp_old_slug';



Only top voted, non community-wiki answers of a minimum length are eligible