Created
November 15, 2018 17:10
-
-
Save tripflex/fbdf624084c08b4df5d51a7aa0c3c59e to your computer and use it in GitHub Desktop.
Add attributes to text field template input when using WP Job Manager Field Editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'field_editor_text_field_attributes', 'smyles_add_text_field_attr', 10, 4 ); | |
function smyles_add_text_field_attr( $attr, $key, $field, $value ){ | |
if( $key === 'some_meta_key' ){ | |
// Add readonly attribute (replacing any others added through this filter) | |
$attr = 'readonly="readonly"'; | |
} | |
return $attr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If using WP Job Manager Field Editor 1.8.5 OR OLDER you need to update the template file here:
https://gist.github.com/tripflex/063f4e7463a0d270a1f717fd4939531d