Support » Plugins » Hacks » Hiding custom post meta

Viewing 6 replies - 1 through 6 (of 6 total)
  • Wrap your code that displays them on the page in an if ( ( current_user_can( $capability ) )

    If you want administrators to only see them the $capability could equal manage_options.

    What I mean is that in the Custom meta block of the edit / add post they are appearing. According to the docs if I prefix the names with _ then they should be hidden but they are not.

    Take a look at the function remove_meta_box()

    I DONT want to remove the meta box. I want to stop my meta data from appearing in the custom meta box which acording to the documenation I do by prefixing with _

    “If you are a plugin/theme developer and you are planning to use custom fields to store parameters related to your plugin or template, it is interesting to note that WordPress won’t show keys starting with an “_” (underscore) in the custom fields list at the page/post editing page or when using the template the_meta() function. Depending on how you plan to use the meta data, you may want to hide the values from the the admin UI by prefixing their names with an underscore. “

    Which is obviously broken



    Forum Moderator

    Which is obviously broken

    Hmm… it’s working just fine in the eShop plugin.

    so I wonder why _fieldname isn’t working for me….

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hiding custom post meta’ is closed to new replies.