• Resolved bhoogterp

    (@bhoogterp)


    Am using WP to do a CMS, and am using PAGES instead of POSTS in order to use the page hierarchy available under WP.

    As such, I found it convenient for sanitation to grab the simple plugin that makes Tags and Categories available for pages: “Post Tags and Categories for Pages”. Nothing fancy in there, it just turns on native Tag/Cat support for Pages, which is off by default.

    As such, I found I had to modify amt-utils.php, line 544 to read:

    – 544: } elseif ( is_single() ) { // pages do not support categories and tags
    + 544: } elseif ( is_singular() ) { // pages do not support categories and tags

    I appreciate using this plugin, although I realize I would lose my changes on an upgrade. Since adding Tags/Cats to pages is a relatively trivial change done by a few plugins, would this be a worthwhile change to effect upon this plugin in case the support is being used?

    http://wordpress.org/plugins/add-meta-tags/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author George Notaras

    (@gnotaras)

    Thank you for your feedback.

    Sounds reasonable, but my only concern about the proposed change is whether it could be the cause of any errors, if the user hasn’t enabled categories & tags for pages. This needs to be tested.

    Nothing fancy in there, it just turns on native Tag/Cat support for Pages, which is off by default.

    I’d appreciate it if you could be more specific about how I could test whether this feature has been enabled or not.

    Plugin Author George Notaras

    (@gnotaras)

    is_object_in_term() seems like a good way to check it. Your feedback is welcome.

    Thread Starter bhoogterp

    (@bhoogterp)

    Enabling the native support uses WP function register_taxonomy_for_object_type.

    Source of this function is wp-includes/taxonomy.php.

    It appears, while not well documented that I can find, that get_object_taxonomies is where you would want to go..

    /**
     * Return all of the taxonomy names that are of $object_type.
     *
     * It appears that this function can be used to find all of the names inside of
     * $wp_taxonomies global variable.
     *
     * <code><?php $taxonomies = get_object_taxonomies('post'); ?></code> Should
     * result in <code>Array('category', 'post_tag')</code>
     *
     * @package WordPress
     * @subpackage Taxonomy
     * @since 2.3.0
     *
     * @uses $wp_taxonomies
     *
     * @param array|string|object $object Name of the type of taxonomy object, or an object (row from posts)
     * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default.
     * @return array The names of all taxonomy of $object_type.
     */
    function get_object_taxonomies($object, $output = 'names') {
    ...
    Thread Starter bhoogterp

    (@bhoogterp)

    Feel free to check out the plugin i’m using… there’s others like it, but it’s extremely simple… it registers the taxonomy, and then just a couple short functions to handle them..

    Post Tags and Categories for Pages

    Thread Starter bhoogterp

    (@bhoogterp)

    Although, technically, I would guess that if tags and categories are disabled for pages, the function requesting a list of them would simply return empty anyway… Could be wrong on that, but it might not require any error checking..

    Plugin Author George Notaras

    (@gnotaras)

    Although, technically, I would guess that if tags and categories are disabled for pages, the function requesting a list of them would simply return empty anyway… Could be wrong on that, but it might not require any error checking.

    You are right. Most probably it will work fine with the proposed modification only.

    The upcoming release will contain the fix. However, I’ll need to thoroughly check whether a similar modification would be required in other parts of the code and also make sure that it will work fine for those who haven’t enabled categories and tags on pages.

    Thanks again for your feedback.

    Plugin Author George Notaras

    (@gnotaras)

    Fixed in 2.4.2. Marking the topic as resolved.

    If you like this plugin, rating it at WordPress.org would be much appreciated. Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Keywords when using Categories and Tags on Pages’ is closed to new replies.