add_action('publish_post','create_custom_field')
function create_custom_field ($post_id) {
global $wpdb;
if ( current_user_can('contributor') ) {
if(get_post_meta($post_id,'custom_field_1',true) == '1'){
add_post_meta($post_ID,'submit','1',true);
return $post_id;
}
return $post_id;
}
}
Related Posts:
- Filtering multiple custom fields with WP REST API 2
- WP REST API: Order posts by meta value (acf)?
- WP Rest endpoint with custom post type and ACF Fields
- Organize media library into folders and get folders via WP Rest API?
- Fill up advanced custom field of a custom post type via API REST POST
- ACF orderby not sorting dates correctly [closed]
- How to import CSV into Custom Post Type custom fields?
- ACF – get fields from group
- How to get “Additional CSS Class” for ACF Gutenberg block
- Advanced Custom Fields select field : How to echo the label, not the value? [closed]
- ACF: get_field() returning false [closed]
- Adding custom fields to the header.php
- How to get_terms() only of terms matching an ACF meta value?
- Query between dates using Date Picker fields
- Showing an ACF field in admin posts dashboard
- Google Places API With ACF [closed]
- Check for the existence of custom field
- ACF Repeater Field, need IF statement for if sub field has content
- Can not create fields in ACF with code
- Advanced Custom Fields – Check if multiple get_fields exist?
- ACF – Custom fields have dissappeared [closed]
- Error in Validate Field with ACF plugin in WordPress
- ACF attachment custom field in rest response
- disable (read only) a field if within a custom post type name
- How to change the page title from functions.php
- Acf Pro repeater field returns null [closed]
- Insert Commas into ACF number field
- Custom Post type with ACF in REST API, how do I get those values?
- How I can check if get_theme_mod is in header or a template part
- Using pre_get_posts for meta value of LIKE comparison on ACF repeater sub field
- Advanced custom fields: Customise date picker’s start date (need to choose year 1500 onwards) [closed]
- ACF Advanced Custom Fields | Help me grab the fields on my WooCommerce homepage [closed]
- My get_terms not working for custom fields
- Updating the database with advanced custom fields
- How to share repeated fields across multiple pages?
- ACF: replace comma with another sign [closed]
- Remove headings option from Wysiwyg editor from ACF in a certain custom post type
- How to break a date from ACF?
- ACF (Advanced Custom Fields) not updating post or postmeta values
- Advanced Custom Fields changes get stuck in cache
- WordPress Date with ACF
- Get image data from advanced custom field [closed]
- Check for image with same filename but different extension
- Advanced Custom Fields if else issue
- If/Else Statement for Advanced Custom Fields
- How to get both image attachment ID and url
- Search and replace not working for ACF Images
- how make file upload field through custom field
- How Do I Use a ACF Custom Field To Add A Slider ID?
- Advanced Custom Fields oembed only outputs YouTube URL
- Hidden field in acf
- Importing ACF code in other page templates
- ACF Content with WPML not saving [closed]
- How do I ensure the social icons appear on all pages? [closed]
- Order get_terms by multiple meta_values
- How can you query posts by advance custom field when the value is a serialized array? [closed]
- Check for duplicate custom field value before running wp_insert_post
- Query by radio button ACF
- Adding new parent item to admin bar
- Display category multi-select with Advanced Custom Felds
- Advanced Custom Fields Plugin: how to use a checkbox to allow a post to show up in desired “zone”?
- ACF: Grid based on field value
- Attaching Image-file to userId
- Advanced Custom Field Textarea not Showing (ListingPro Theme)
- Two problems that are likely related to AJAX
- ACF – Eliminate unnecessary data and print
- Is there any way to bulk search-replace URLs that exist within ACF’s “Link” field type (serialized)?
- Get values from an advanced custom field
- Edit (advanced) customs fields on page template
- ACF Posts in Theme Options only returning when logged in? Bug?
- Advanced Custom Fields frontend form submission
- Display of Custom Fields based on conditional if/and according to category/tag choice
- Comparing two dates (ACF and current time)
- Advanced Custom Fields Gallery and Flex Slider [reformuled]
- Advanced Custom Fields oEmbed video width and height
- Display ACF field(s) from widget in FE
- Convert number to date format within an array
- ACF not updating value correctly
- ACF Repeater and Sort
- Advanced Custom Fields, DatePicker – Check if Set
- How to access advance custom fields with post type in a for each loop
- Pin to Top Functionality using orderby custom field then event date
- Acf Pro repeater field returns null when call inside foreach
- Relationship field search not retriving posts in admin
- advanced custom fields plugin last input field in new posts
- WordPress loop based on url sting
- Display “Today” Instead of Date for Pubslished Posts
- Updating custom fields with data from the database
- Advanced Custom Fields repeter field expiration
- Getting “Invalid argument supplied for foreach()” Warning
- WordPress/Timber/Twig – Trying to output checkbox values [closed]
- How to use WordPress to embed a SoundCloud download link?
- upgrading ACF (advanced custom fields) on an old site [closed]
- Generate the post title from ACF fields
- How to indicate a parent child category relationship when bulk importing
- Get ACF time in His format
- Filtering custom post admin listing page elements based on acf user field
- Parsing value from Lottie JSON file
- How do I add an ACF shortcode to a non-ACF page?
- Convert acf/gutenberg markup to html