Add class to all meta boxes for a custom post type

After doing some playing around, I discovered this can actually be accomplished by defining the name of the hook I want to add the filter to via a variable. So if my $post_type_name is portfolio and my $box_id is piece_info, I can make a filter as follows: function add_meta_box_class( $classes ) { array_push( $classes, ‘custom-class’); … Read more

Add audio file to post using custom term meta field as link [closed]

I figured it out! Using this code I was able to use my custom meta field as the link in the audio shortcode. First I created a function in functions.php: function audio_link() { $terms = get_the_terms($post->ID, ‘taxonomy-name’); $result = “”; if (is_array($terms) || is_object($terms)){ foreach ($terms as $term) { $term_id = $term->term_id; $result .= get_term_meta( … Read more

How to find php variable of wordpress theme settings

Plugin options are normally stored in the wp_options table. If you look at the plugin code (and reference the Plugin information in Codex; you can start here: https://codex.wordpress.org/Writing_a_Plugin ), you will see how the plugin names the option. Then you can create a function that will change that option value. Note that most plugins store … Read more

saving variables after redirect

You could store the password as a transient, then pass the transient key in the URL instead so it can be retrieved using that key on the next page. function process_my_form() { if ( ! empty($_POST[‘password’]) ) { $password = ($_POST[‘password’]); } else {return;} /* Store Password via Transient API */ $passkey = wp_generate_password(12, false); … Read more