Tag Info

New answers tagged

0

Well, that was interesting and unexplained. I went to wp-admin/edit-tags.php?taxonomy=category and added a new dummy subcategory under a top level category, and then deleted it. Lo and behold, both of my problems are gone. Visit www.whatsthatbug.com and see for yourself if you wish. I have no idea what caused the problem or why that would have fixed it, but ...


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

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"]'); ...


0

I guess it depends on how much work you're wanting to put in. Gravity Forms plugin will do most of what you want (with some customization), or you could write something completely from scratch: maybe something like registering an "application" CPT that has all info as meta data, and you can sort/filter by user. I don't think adding all applications to user ...


0

I think you are jumping a gun with custom SQL, complexity of this seems still in realm of WP_Query. Even if not it's a good idea to start with it to have more solid base for custom SQL. If I try something like this: $meta_query = array( array( 'key' => 'body_type', 'value' => 'bt' ), array( 'key' => 'Make', 'value' => 'make' ), ...


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 ...


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.


0

You can just call get_user_meta without specifying a key, and it will return all MetaValues for the user. $userdata = get_user_meta( $userID ); You may have to do a mapping for displaytitles of the Metavalue, as they are returned in an array, where the keys are the databasevalues of your metakeys. For example, you may get ...


0

I've resolved the problem with explained here : http://marketermatt.com/export-navigation-menus/ But i would like to warn the people that will try this solution, you have to have a database backup of WordPress system which has Menu that you would like to revert BackUp your WP database to your PC (bacause, you will use this for reverting back your system ...


0

Steven, I think you are looking for the save_post action, you should create the function you want to use and use the add_action function. You can find the data from the custom fields in the $_POST array. You don't have to worry about the "other content", at least if with that you are referring to the title, content, categories.


0

there are two possible injection vectors, server side and client side server side - Just don't write your own SQL and use the more high level DB access APIs, in your case probably update_option. If you must to access the DB at lower level make sure the API use wpdb::prepare while generating the SQL, which is true for insert but not true for query which ...


0

Solved: this was a folder permissions issue which was fixed with a chmod to the parent folder containing the affected assets. The appropriate permissions level in this case was 755. Hardening WordPress


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


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 ...


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';


0

the auto_increment value by itself is not important, but the fact that you got there indicates that you do a lot of option insertion either directly or more likely as a transients. As said above, by itself that value is meaningless and even having 1k options should not impact the performance that much if they are auto loading. I would guess that your ...


0

I had a similar issue on another site recently, memory usage was through the roof. When I checked the db, wp_options was about 80megabytes. Running this SQL reduced the entire db to 15mb: DELETE FROM `wp_options` WHERE `option_name` LIKE '%_transient_%' Obviously, replace wp_ with your table prefix.


0

As you can read in the WordPress Codex, you have to write your own save function for any meta box anyways. So instead of saving those values with a function like update_post_meta(), you could simply implement your own saving function using another table. But you also have to write a corresponding load function, as the using get_post_meta() function in the ...


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.


-2

Suppose you want to append blog before post in url than make sure that your blog page's slug name is blog . Then go to WP-admin-panel > settings > permalink and choose the last option "custom structure" and add following in it: /blog/%postname%/ and save changes. It will be only applied to your blog page, other page will not display blog as parent.


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');


0

If this is in the admin, use the action parameter: <a href="<?php echo esc_url( admin_url( "?action=delete_ticket&ticket_id=$ticket->ID" ) ?>">Delete item</a> ...and then hook appropriately: function wpse_159391_delete_ticket() { if ( isset( $_GET['ticket_id'] ) ) { // delete it! } } add_action( ...


0

you can use this plugin for doing this: phpBB Bridge also you can find more useful description in this stackoverflow Question: How to integrate phpBB with Wordpress


0

When you use $wpdb->prepare the placeholder %s is replaced with something between quotes, so, your query becomes: "SELECT * FROM 'wp_users' WHERE ID = 1" but table names in SQL queries must not be wrapped in quotes. So, the right way is: $sql = $wpdb->prepare( "SELECT * FROM {$wpdb->users} WHERE ID = %d", 1 ); $results = ...


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 ...


0

Using the FTP of cPanel's File Manager, just get into root/wp-content/plugins and select all the plugins and move them on step up, so the plugins folder will be empty. Clear the browser cache, and try to get into the Admin panel. Doing this WordPress won't try to initiate any of your plugins, and you know plugins are additional to WordPress, not mandatory. ...


0

<?php if(isset($_POST['save'])){ $wpdb->insert('wp_table_name', array( 'field_a' => maybe_serialize( $_POST['field_a'] ), 'field_b' => maybe_serialize( $_POST['field_b'] ), 'field_c' => maybe_serialize( $_POST['field_c'] ), 'field_d' => maybe_serialize( ...


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 ...


0

This is an old problem I had forgotten about. The problem here is that an old database was selected in the left hand menu of phpMyAdmin(read: I'm new to database management). The table was already in use and therefore populated - this error message is because phpMyAdmin tried to write to the first line, couldn't(already held data) and then quit. Simply ...


0

Whenever I'm trying to link two sites, I find the most efficient and least destructive way is to use the WordPress XMLRPC API. http://codex.wordpress.org/XML-RPC_WordPress_API/Posts In this case, you could pull this info through using the built in IXR_Client library. This saves a ton of time writing code and trying to mix databases. If they wind up on ...


0

I finally found the custom post type data. It is stored in the wp_post table where post_type = custom post type (e.g. "products"). The field (column) data is stored in wp_postmeta where the meta_key is the column name and meta_value is the column value. This query will bring back all data associated with the custom post type "products": SELECT P.ID, ...


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 ...



Top 50 recent answers are included