New answers tagged database
0
votes
Custom AJAX Endpoint not returning any result
It seems the issue is because of incorrect hook_name. You have used wp_ajax_no_priv_{$action} instead of wp_ajax_nopriv_{$action}
Also use wp_send_json() for send response in json format.
add_action('...
1
vote
Custom AJAX Endpoint not returning any result
You need to use the defined namespace as the prefix for the add_action callbacks so that PHP knows which function it is supposed to call. More on this here, add_action in namespace not working
The ...
1
vote
Accepted
Building a REST API for your web app exposes primary keys of DB records?
You are right, APIs should not expose internal data and structures, but if you depend on APIs not written by you, it will rarely be a good use of your time to develop a different API just feel better ...
1
vote
Bulk Updating Post Date in 1 day Increments
You could start from today and just work backwards, one day at a time:
$start_hour = 8;
$end_hour = 17;
$date = new DateTime;
foreach ( $posts as $post ) {
$time = sprintf(
/* Left-pad ...
1
vote
Accepted
How to insert and call new data in wordpress website database through a plugin
The right place to store the data depends on how you will be using the data. From the context, it sounds like metadata might be the right place. There is usermeta if the data relates to one of your ...
0
votes
Accepted
get value from 'terms' table
get_terms does indeed fetch from the terms table, but it does also use a join on the taxonomy table, since you need to specify which taxonomies you want terms for in your get_terms query.
If you want ...
0
votes
Get a custom table to an array
you can take every rows from a table YOUR_TABALE_NAME
"SELECT * FROM {$wpdb->prefix}YOUR_TABALE_NAME"
then with the get_results() return it into an array $array
finally you have somthing ...
Top 50 recent answers are included
Related Tags
database × 2461mysql × 382
php × 247
plugins × 243
wpdb × 233
plugin-development × 160
sql × 140
multisite × 116
posts × 112
customization × 109
custom-post-types × 107
query × 102
users × 98
wp-query × 97
migration × 93
options × 71
forms × 70
custom-field × 69
errors × 66
phpmyadmin × 60
table × 58
post-meta × 57
performance × 50
user-meta × 48
functions × 45