Tag Info

New answers tagged

1

Your post type is all wrong. Custom post type names cannot contain spaces or camelcase, also names should not contain special characters. Custom post type names, and for that matter, custom taxonomy names should be all lowercase letters, and names must only be separated by underscores (_) Have a look at the $post_type parameter in register_post_type ...


0

You need to use the type parameter for custom field. Try this once <?php $currentshowid = get_the_ID(); $today = date('Y-m-d'); $args = array( 'meta_key' => 'show_id', 'meta_value' => $currentshowid, 'orderby' => 'meta_value_num', 'order' => ASC, 'meta_query' =>array( ...


1

Auto-generate shortcodes from an array: You can try the following Shortcode Automat: /** * Setup the Shortcode Automat * */ function shortcode_automat_setup() { $settings = array( "get_address" => "mg_admin_address", "get_phone" => "mg_admin_phone", "get_fax" => "mg_admin_fax", "get_email" ...


1

Try this, $categories_array = array() $categories = get_categories(); foreach($categories as $category){ $categories_array[] = $category->term_id; } array( 'param_name' => 'category_id', 'type' => 'dropdown', 'value' => $categories_array, // here I'm stuck 'heading' => __('Category ...


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



Top 50 recent answers are included