Tag Info

New answers tagged

0

Perhaps using SQL statement? Direct SQL queries are very dangerous, especially when updating the DB. At the very least you will get any object cache out of sync and you might miss execution of import action and filters. If this update is something that is rarely done it is better that it will take one more minute then to risk the integrity of your ...


1

For intensive processes like this, it might be best to schedule a WP cron event to handle the process on a daily or twice daily schedule. Checkout this WP Codex page for the wp_schedule_event() function


0

Ok, i've found the trouble. It was in logic. Solution: foreach($fields as $name => $field){ if($field['name'] == 'local_players'){ if(!empty($local_players)){ update_post_meta($postID, '_' . $field['name'], $field['field']); update_post_meta($postID, $field['name'], ...


0

The code snippet in question is: $check = apply_filters( "update_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $prev_value ); if ( null !== $check ) return (bool) $check; This filter only allows you to prevent the updating of the metadata for a given type, not to explicitly change the metadata itself. If you want to use this ...


2

You should not be using a direct SQL. Consider creating a PHP script which loads WordPress core and uses proper functions (see http://stackoverflow.com/questions/9101503/include-wordpress-core-into-own-scripts#answer-9126230 for getting an idea how to do that). add_post_meta update_post_meta But if you do want to create custom SQL (if you are asking the ...


2

meta_id in postmeta table is just an AUTO_INCREMENT id for the table, you can easily inspect that: So, your guess is correct, you can leave it. EDIT Avoid raw SQL statements and introduce $wpdb for SQL purposes. And for postmeta insertion you can see the following tutorial I found a best one: Reusable Custom Meta Boxes - Code.TutsPlus.com


0

wp_editor function accepts (array) $settings param and that one can contain textarea_name as a key. If it's not being specified, it's set by default as $editor_id. See: https://github.com/WordPress/WordPress/blob/c392ff6f90d550bad876d8a984ad6b3b8a49cd96/wp-includes/class-wp-editor.php#L44 So you might want to do something like this: foreach ($get_url as ...


-1

So, after messing around with my entire functions.php, I figured out where the actual problem was. The function for displaying the meta box was incorrect BEFORE function kk_custom_meta_box2( $object, $box ) { ?> <?php wp_nonce_field( 'location_map_nonce_action', 'location_map_nonce' ); ?> <p> <label for="location-map"><?php ...



Top 50 recent answers are included