Add custom fields to wp native gallery settings

Thanks for your code. I’ve investigated this issue further (this is not an integer formatting problem). The only solution I came up with for number fields is to monkey patch more WP JS. Here is entire code with modifications which supports any input type: add_action(‘print_media_templates’, function(){ ?> <script type=”text/html” id=”tmpl-custom-gallery-setting”> <h3>Custom Settings</h3> <label class=”setting”> <span><?php … Read more

Max length of meta_value

Both usermeta.meta_value and postmeta.meta_value are stored as LONGTEXT. Here’s how the MySQL docs describe the size of a LONGTEXT data type: “A TEXT column with a maximum length of 4,294,967,295 or 4GB (232 – 1) characters. The effective maximum length is less if the value contains multi-byte characters. The effective maximum length of LONGTEXT columns … Read more

Validating Custom Meta Box Values & Required Fields

The easiest way is to add Javascript validation via the jQuery Validate plugin. Here’s the most basic walkthrough: Near your add_meta_box call, enqueue the jQuery Validate plugin as well as a JS file for your simple script: add_action(‘admin_enqueue_scripts’, ‘add_my_js’); function add_my_js(){ wp_enqueue_script(‘my_validate’, ‘path/to/jquery.validate.min.js’, array(‘jquery’)); wp_enqueue_script(‘my_script_js’, ‘path/to/my_script.js’); } Then in my_script.js include the following: jQuery().ready(function() { … Read more

Show Custom Fields in Quick Edit

After adding our custom column, we are ready to expand our Post Quick Edit menu using the quick_edit_custom_box action hook. Note – The quick_edit_custom_box action hook will not fire unless there are custom columns present. That is why we started by adding a custom column. add_action(‘quick_edit_custom_box’, ‘shiba_add_quick_edit’, 10, 2); function shiba_add_quick_edit($column_name, $post_type) { if ($column_name … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)