Articles of input

Custom Post Type, Saving Multiple Checkboxes

For a custom post type, I’m pulling in a list of another custom post types that I need to select for saving … <input type=”checkbox” name=”32″> My CPT <br> <input type=”checkbox” name=”41″> My CPT 2 <br> <input type=”checkbox” name=”42″> My CPT 3 <br> <input type=”checkbox” name=”43″> My CPT 4 It’s easy enough to save a […]

wp_insert_post add meta_input

In the documentation of wp_insert_post there is a changelog on half of the page which says the following: Since: WordPress 4.4.0 A ‘meta_input‘ array can now be passed to $postarr to add post meta data. I’m using WordPress 4.4.2. I’ll try to add a new post by running the code as follows: function handle_post($post) { […]

How do I setup nested repeatable option fields?

I’m trying to wrap my head around how to create a set of option fields that should be able to repeat for as many times as possible. But I’m having a hard time to figure out how to proceed. Currently I’ve setup the visual interface for administering the options, but I have no idea how […]

How to get the image url in the input box from media library?

I have added a post meta to upload image using wordpress media uploader. Looks like it’s a javascript work. I am no good in javascript. I took the js from here: Here is the js code: jQuery(document).ready(function($){ // Instantiates the variable that holds the media library frame. var meta_image_frame; // Runs when the image button […]

WordPress widget / plugin…fields not appearing in my widget

Trying to create my first plugin. A simple one. It’s doing mainly what I want to do except the widget itself in Appearance–>Widgets doesn’t display my fields. Wondering if anyone could point me in the right direction to make my fields appear? function form($instance) { $title = esc_attr($instance[‘title’]); ?> <p><label for=”<?php echo $this->get_field_id(‘title’); ?>”> <?php […]

How to replace a javascript select box onchange event to a form submit action?

I have a small problem that probably has a very simple fix. I have been using the wp_get_archives() function to produce a dropdown select form. See the full code below: <form id=”side-arch”> <select name=”archive-dropdown” onchange=”document.location.href=this.options[this.selectedIndex].value;”> <option value=””><?php echo esc_attr( __( ‘Select Month’ ) ); ?></option> <?php wp_get_archives( array( ‘type’ => ‘monthly’, ‘format’ => ‘option’, ‘show_post_count’ […]

Add description text under input field for new profile fields

How can I modify my following code to add some description text under the input fields? I tried modifying it as you can see with the facebook url field but the text shows up under the field label and not the actual input field — function modify_contact_methods($profile_fields) { // Add new fields $profile_fields[‘address’] = ‘Address’; […]

Add input field to 'Pages > Edit Page' through functions.php

Original Question: I’m trying to add an input field to ‘Pages > Edit Page’. The use of this input field will be for a user to add an ID of a slider, so that that slider will be page specific. Example: User adds slide ID to input field on Edit Page screen. Page pulls in […]

Let users create a new custom taxonomy entry from frontend (without creating a post)

I have created a custom taxonomy called “Club” (a group of people). This enables me to group posts from contributors (like tags). I use the plugin “Quick Post Widget” to let enter their posts form frontend. In Quick Post Widget’s form they can choose their “Club” (or enter a new one). Here is my question: […]

Add extra field to users

I have this code that adds the check box to the ‘Edit User’ page but when i check it, and refresh the page, the box becomes unchecked… what is wrong? add_action( ‘show_user_profile’, ‘module_user_profile_fields’ ); add_action( ‘edit_user_profile’, ‘module_user_profile_fields’ ); function module_user_profile_fields( $user ) { ?> <h3>Module Options</h3> <table class=”form-table”> <tr> <th><label for=”module_activation”>Module Activation</label></th> <td> <input id=”module_activation” […]