How to rename a custom field?
I found the answer UPDATE `wp_postmeta` SET `meta_key` = ‘ref’ WHERE `meta_key` = ‘refer’ use this part in your SQL Reference
I found the answer UPDATE `wp_postmeta` SET `meta_key` = ‘ref’ WHERE `meta_key` = ‘refer’ use this part in your SQL Reference
If your custom page template filename is foobar.php, you can use get_post_meta(): global $post; if ( ‘foobar.php’ == get_post_meta( $post->ID, ‘_wp_page_template’, true ) ) { // The current page has the foobar template assigned // do something } Personally, I like calling this inside my add_meta_boxes_page callback, and wrapping it around the add_meta_box() call itself. … Read more
you can use get_post_custom() which returns a multidimensional array with all custom fields of a particular post or page: echo ‘<pre>’; print_r(get_post_custom($post_id)); echo ‘</pre>’;
Here is the solution. Hope it will help you const { registerPlugin } = wp.plugins; const { PluginDocumentSettingPanel } = wp.editPost; const MyDocumentSettingTest = () => ( <PluginDocumentSettingPanel className=”my-document-setting-plugin” title=”My Panel”> <p>My Document Setting Panel</p> </PluginDocumentSettingPanel> ); registerPlugin( ‘document-setting-test’, { render: MyDocumentSettingTest } ); https://github.com/WordPress/gutenberg/blob/master/packages/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js#L86
As Mamaduka said there is currently no (native) way of storing meta-data for taxonmies. There is talk of it. But it has stalled since its proving difficult to agree on how best to implement it. For large amounts of data you might not want to use the options table. Alternatively you can create your own … Read more
The meta_value is not of an integer type for max to return proper values. You can use mysql cast method to convert into integers as follows: SELECT max(cast(meta_value as unsigned)) FROM wp_postmeta WHERE meta_key=’price’
please never do this: ‘value’ => $_GET[‘s’] … $query->get(‘s’);, get_search_query, or sanitize_key($_GET[‘s’]) are all safer options. Technically we shouldn’t be using get-params in wordpress at all, it’s not a best-practice. That get value could be all sorts of bad things, & we don’t want to pass it along to the db without making sure it’s … Read more
You could use a plugin like “Search Everything” which lets you toggle what to include in the search (including Custom Fields). Check it out here: http://wordpress.org/extend/plugins/search-everything/
I found last part of @birgire answer the most useful way, however it breaks the possibility to tab to content. In fact I think is normal focus the content by click tab while in the subtitle field. To do that, you have also to take care if the content is shown in the “Text” tab … Read more
You should (if available) submit the code you are working with, even if just a snippet, so we can assess your process in relation to your question. The short answer however is YES, it is safe, so long as you, prevent input fields being displayed on user profile page for certain user roles prevent unauthorized … Read more