How to reload the role specific registration form on validation errors?

You can either user session or cookies to setup the user for the desired role e.g: /** * register_roles_with_cookies */ class register_roles_with_cookies { function __construct($args = array()){ //create a hidden field for role and extra fields needed add_action(‘register_form’,array($this,’add_hidden_role_field’)); //validate add_action(‘register_post’,array($this,’my_user_fields_validation’),10,3); //save the role add_action(‘user_register’, array($this,’update_role’)); } public function setCookie($name,$val,$time = false){ if(false === $time) $time … Read more

Determine when a custom field was last updated?

I would add another custom field that stores the update time. Then create an add_action function for update_post_meta to also save the timestamp at the same time you write to CUSTOMFIELD. The action triggered when adding a custom field is add_post_meta and when updating a custom field update_post_meta

Create ul list in Custom Meta Box?

You can add your information in regular metabox textarea and separate prospective list items with new line. Then just format it as list in your template: <?php $list_items = get_post_meta($post->ID, ‘your_custom_field_name’, true); if($list_items){ $list_items = explode(“\n”, $list_items) echo ‘<ul>’; foreach($list_items as $list_item) { echo ‘<li>’ . $list_item . ‘</li>’; } echo ‘</ul>’; } Or you … Read more

Order Custom post type loop by custom field (datepicker)

Your second approach should in my mind actually work, you do it like this: Code: $args = array( ‘post_type’ => ‘agenda’, ‘posts_per_page’ => -1, ‘meta_key’ => ‘datum_agenda’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’ ); $my_query = new WP_Query( $args ); There are two pages at the ACF documentation you might want to read: Date Picker … Read more

Create a select drop down of available menus

It is not intuitive but get_terms will do it, if I understand what you need. var_dump(get_terms( ‘nav_menu’)); If you look in the *_term_taxonomy table you can see why. The menus are stored as a taxonomy named nav_menu. This won’t get you things like page menus, only the intentionally created menus.

Getting Custom Field data from a page hierarchy

This one might get you started (this one is for the size as you can see since i do value 1 times value 2) (just to give an example of more advanced queries) global $edl_global_join; global $edl_global_orderby; global $wp_query; function edl_posts_join ($join) { global $edl_global_join; if ($edl_global_join) $join .= ” $edl_global_join”; return $join; } function … Read more

Metabox nonce PHP notice

// Save the Metabox Data function wpt_save_product_meta($post_id, $post) { if($post->post_type!=’post type with metabox’) { return $post->ID; } // verify this came from the our screen and with proper authorization, // because save_post can be triggered at other times if ( !wp_verify_nonce( $_POST[‘product_noncename’], plugin_basename(__FILE__) )) { return $post->ID; } // Is the user allowed to edit … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)