[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

bw_default_taxonomy_labels() – Set default custom taxonomy labels

Description

Set default custom taxonomy labels

It looks like these are the same as for post types – let's check OK, there are a few more… we'll call default_labels first then. By default tag labels are used for non-hierarchical types and category labels for hierarchical ones. Default: if empty, name is set to label value, and singular_name is set to name value

x 'name' - general name for the taxonomy, usually plural. The same as and overridden by $tax->label. Default is _x( 'Post Tags', 'taxonomy general name' ) or _x( 'Categories', 'taxonomy general name' ). When internationalizing this string, please use a gettext context matching your post type. Example: _x('Writers', 'taxonomy general name'); 
x 'singular_name' - name for one object of this taxonomy. Default is _x( 'Post Tag', 'taxonomy singular name' ) or _x( 'Category', 'taxonomy singular name' ). When internationalizing this string, please use a gettext context matching your post type. Example: _x('Writer', 'taxonomy singular name'); 
x 'menu_name' - the menu name text. This string is the name to give menu items. Defaults to value of name 
x 'all_items' - the all items text. Default is __( 'All Tags' ) or __( 'All Categories' ) 
x 'edit_item' - the edit item text. Default is __( 'Edit Tag' ) or __( 'Edit Category' ) 
x 'view_item' - the view item text, Default is __( 'View Tag' ) or __( 'View Category' ) 

'update_item' - the update item text. Default is __( 'Update Tag' ) or __( 'Update Category' ) 
x 'add_new_item' - the add new item text. Default is __( 'Add New Tag' ) or __( 'Add New Category' ) 
'new_item_name' - the new item name text. Default is __( 'New Tag Name' ) or __( 'New Category Name' ) 
'parent_item' - the parent item text. This string is not used on non-hierarchical taxonomies such as post tags. Default is null or __( 'Parent Category' ) 
'parent_item_colon' - The same as parent_item, but with colon : in the end null, __( 'Parent Category:' ) 
x 'search_items' - the search items text. Default is __( 'Search Tags' ) or __( 'Search Categories' ) 
'popular_items' - the popular items text. Default is __( 'Popular Tags' ) or null 
'separate_items_with_commas' - the separate item with commas text used in the taxonomy meta box. This string isn't used on hierarchical taxonomies. Default is __( 'Separate tags with commas' ), or null 
'add_or_remove_items' - the add or remove items text and used in the meta box when JavaScript is disabled. This string isn't used on hierarchical taxonomies. Default is __( 'Add or remove tags' ) or null 
'choose_from_most_used' - the choose from most used text used in the taxonomy meta box. This string isn't used on hierarchical taxonomies. Default is __( 'Choose from the most used tags' ) or null 
'not_found' (3.6+) - the text displayed via clicking 'Choose from the most used tags' in the taxonomy meta box when no tags are available. This string isn't used on hierarchical taxonomies. Default is __( 'No tags found.' ) or null 

Usage

$array = bw_default_taxonomy_labels( $labels );

Parameters

$labels
( array ) optional – An array of labels for this taxonomy.

Returns

array labels with defaults applied

Source

File name: oik/includes/bw_register.php
Lines:
1 to 24 of 24
function bw_default_taxonomy_labels( $labels = array() ) {
  $labels = bw_default_labels( $labels );
  $ucplural = bw_array_get( $labels, "name", null );
  $ucsingular =  bw_array_get( $labels, "singular_name", $ucplural );
    /* translators: %s: post type label plural capitalised */
  $labels['update_item'] = bw_array_get( $labels, "update_item" , sprintf( __( 'Update %1$s',  "oik" ), $ucplural ) );
    /* translators: %s: post type label singular capitalised */
  $labels['new_item_name'] = bw_array_get( $labels, "new_item_name" , sprintf( __( 'New %1$s', "oik" ), $ucsingular ) );
    /* translators: %s: post type label singular capitalised */
  $labels['parent_item'] = bw_array_get( $labels, "parent_item" , sprintf( __( 'Parent %1$s', "oik" ), $ucsingular ) );
    /* translators: %s: post type label singular capitalised */
  $labels['parent_item_colon'] = bw_array_get( $labels, "parent_item_colon" , sprintf( __( 'Parent %1$s:', "oik" ), $ucsingular ) );
    /* translators: %s: post type label plural capitalised */
  $labels['popular_items'] = bw_array_get( $labels, "popular_items" , sprintf( __( 'Popular %1$s', "oik" ), $ucplural ) );
    /* translators: %s: post type label plural capitalised */
  $labels['separate_items_with_commas'] = bw_array_get( $labels, "separate_items_with_commas", sprintf( __( 'Separate %1$s with commas', "oik" ), $ucplural ) );
    /* translators: %s: post type label plural capitalised */
  $labels['add_or_remove_items'] = bw_array_get( $labels, "add_or_remove_items", sprintf( __( 'Add or remove %1$s', "oik" ), $ucplural ) );
    /* translators: %s: post type label plural capitalised */
  $labels['choose_from_most_used'] = bw_array_get( $labels, "choose_from_most_used", sprintf( __( 'Choose from most used %1$s', "oik" ), $ucplural ) );
  // $labels['not_found'] = bw_array_get( $labels, "not_found", sprintf( __( 'No %1$s found', "oik") , $ucplural ) );
  //bw_trace2();
  return( $labels );
}  
 
 View on GitHub View on Trac

Called by

1 to 5 of 5
  • bw_default_taxonomy_args() – Set default args for a taxonomy
  • Tests_includes_bw_register::test_bw_default_taxonomy_labels() –
  • Tests_includes_bw_register::test_bw_default_taxonomy_labels_bb_BB() –
  • Tests_includes_bw_register::test_bw_default_taxonomy_labels_themes() –
  • Tests_includes_bw_register::test_bw_default_taxonomy_labels_themes_bb_BB() –

Invoked by

    Calls

    1 to 2 of 2
    • bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
    • bw_default_labels() – Attempt to set labels given the ‘name’ and/or ‘singular_name’

    Call hooks

    Function name: bw_default_taxonomy_labels
    Plugin ref: oik – oik information kit
    Version: 4.15.3
    Sourcefile: includes/bw_register.php
    File ref: includes/bw_register.php
    Deprecated?: No
    API Letters: B,D,L,T

    Published: February 2, 2018 | Last updated: February 2, 2018

    Information

    Function name: bw_default_taxonomy_labels
    Plugin ref: oik – oik information kit
    Version: 4.15.3
    Sourcefile: includes/bw_register.php
    File ref: includes/bw_register.php
    Deprecated?: No
    API Letters: B,D,L,T

    Recent plugin updates

    oik-weight-zone-shipping v0.2.13 oik-weight-zone-shipping v0.2.13 has been tested with WooCommerce 10.1.2 and WordPress 6.8.2 ...
    SB Children Block v1.3.0 Upgrade to SB Children Block v1.3.0 for support for PHP 8.3 and PHP 8.4  ...
    oik v4.15.3 Update to oik v4.15.3 for a couple of security fixes. Tested with WordPress 6.8.2 ...
    oik-privacy-policy v1.4.9 Update to oik-privacy-policy v1.4.9 for a security fix. Tested with WordPress 6.8.2 and PHP 8.3 and PHP 8.4 ...
    oik-nivo-slider v1.17.0 oik-nivo-slider v1.17.0 introduces the Nivo slider block - oik-nivo-slider/nivo. ...

    Plugins

    • All Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins

    Themes

    • FREE themes
    • Bespoke themes
    • Premium themes

    Blocks

    • All Blocks
    • Block examples
    • About Blocks

    Shortcodes

    • All Shortcodes
    • Shortcode examples
    • About Shortcodes

    Reference

    • About APIs
    • All APIs
    • All Classes
    • All Files
    • All Hooks

    Support

    • Contact
    • Cookies policy
    • Get API key
    • Privacy
    • Request support
    • Sitemap
    • Stay informed
    • Terms and Conditions
    oik-plugins
    Email: herb@bobbingwide.com

    Weight shipping plugins

    Find out which cart weight shipping plugin you need for your WooCommerce site.
    Which cart weight based plugin do I need?

    Site:  www.oik-plugins.com
    © Copyright oik-plugins 2011-2025. All rights reserved.


    Website designed and developed by Herb Miller of Bobbing Wide
    Proudly powered by WordPress and oik-plugins

    WordPress version: 6.8.3

    Gutenberg version: 21.7.0

    PHP version: 8.2.29