Website that sells statistics

Well to say that these custom fields are insecure in the wp core tables is to say that the usernames and passwords are also insecure, along with any private or password protected posts. As long as you are not outputting these custom fields anywhere but a secure page for logged in, paid up users, no … Read more

Show or hide custom fields by user’s role [frontend]

Yes, it is possible to hide or show custom fields by user’s role. Use current_user_can() for finding current user role. This function returns true if current user has capability or role. For example your current user is “wholesale” then you can use like this: <?php if( current_user_can(‘wholesale’)) { ?> // stuff here for wholesale <?php … Read more

Hiding custom fields when content is empty [closed]

Got it! I needed to add this line: if ( $other_details = get_post_meta( $order->id, ‘Other Details’, true ) ) { So the full code for the block I needed to change would be: /** * Add the fields to order confirmation/thank you page. **/ add_action( ‘woocommerce_order_details_after_order_table’, “my_woocommerce_other_details_after_order_table”, 10, 1 ); function my_woocommerce_other_details_after_order_table( $order ) { … Read more

Advanced Custom Fields for Header that are Editable from a Page [closed]

Assuming you are working with a theme supporting the WP customizer: Using the customizer.php file (can be found in sub-folder ‘inc’, or perform a search, varies from theme to theme. Make you own = Customizer API) So, in your customizer.php – Add this: // Add to customizer.php inside function your_customizer($wp_customize) {} $wp_customize->add_setting( ‘live_in_ctc’, array( ‘default’ … Read more

Using CMB2 Plugin to create text_date metabox (datepicker) How do I save multiple dates? [closed]

In CMB2 you can use the group type to create a repeating fields, then inside the group, you declare the text_date type. Let’s say you have an Events where you set multiple dates. $events = new_cmb2_box([ ‘id’ => ‘events_metabox’, ‘title’ => __(‘Events’, ‘text_domain’), ‘object_types’ => …, ‘show_on’ => …, … ]); $events_group_id = $events->add_field([ ‘id’ … Read more

Media Custom Fields – get a value with PHP

As taken from : http://wordpress.org/extend/plugins/media-custom-fields/faq/ How does this plugin handle my data? Media items are stored in WordPress just like regular posts. This enables us to use native WordPress functions to store and retrieve your custom fields. Due to this, your data is stored in a very future-proof way, in the postmeta table of the … Read more

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