Filters not working
-
Hello there,
I’m trying to apply your filters and change things like priority and other attributes. It doesn’t work unfortunately. Here is my code.
add_action( 'init', 'modify_listing_fields'); function modify_listing_fields(){ add_filter( 'submit_job_form_fields', 'featured_image' ); add_filter( 'submit_job_form_fields', 'gallery_images' ); } function featured_image( $fields ){ $fields[ 'job' ][ 'featured_image' ] = array( 'label' => __( 'Cover Image', 'listify' ), 'type' => 'file', 'required' => false, 'placeholder' => '', 'priority' => 2, 'ajax' => true, 'allowed_mime_types' => array( 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png' ) ); return $fields; } function gallery_images( $fields ){ $fields[ 'job' ][ 'gallery_images' ] = array( 'label' => __( 'Gallery Images', 'listify' ), 'type' => 'file', 'multiple' => true, 'required' => false, 'placeholder' => '', 'priority' => 3, 'ajax' => true, 'allowed_mime_types' => array( 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png' ) ); return $fields; }I have to say that these 2 custom fields have been added to my theme which is Listify and I’m actually using a child theme, for this reason I’m trying to overriding the hook priority using ‘init’.
Debug is silent.
Any suggestion?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Filters not working’ is closed to new replies.