WOOF

Extends WOOF_Wrap

Methods

The major class in the API providing a point of entry into the rest of the API through the global variable $wf.

List of Methods

Magic Methods

  • __call( String $name, Array $arguments )Mixed OR WOOF_Silent

    Implements PHP’s __call magic method to provide a number of clever handlers for the unknown method call.

  • __get( String $name )Mixed OR WOOF_Silent

    Implements PHP’s __get magic method to provides a number of clever handlers for the unknown property access.

Property Methods

  • domain_of_url( $input )String

    Extracts the full domain of a given URL.

  • has_children()Boolean

    Checks if the current WordPress WOOF::object has any children.Note: this will only return meaningful results if the current object is a post or term (and the post type / taxonomy is hierarchical respectively).

  • id()Integer

    Returns the database id of the current WordPress WOOF::object. This method will likely be most useful when creating custom SQL queries. .

  • id_for_slug( String $slug, String $type = post )Integer OR Boolean

    Returns the post ID for a given slug name and post type, if found.

  • is_a( String $type )Boolean

    Checks if the current WordPress WOOF::object is of the given type.Type has different meanings depending on what the current object is:If the object is a post, type would be the name of a post typeIf the object is a term, type would be the name of a taxonomyIf the object is a user, type would be a user role This method would be useful to display different things in a common include file, based on the current object, for example.

  • is_an( String $type )Boolean

    A synonym for WOOF::is_a, to check if the current WordPress WOOF::object is of the given type.Type has different meanings depending on what the current object is:If the object is a post, type would be the name of a post typeIf the object is a term, type would be the name of a taxonomyIf the object is a user, type would be a user role This method would be useful to display different things in a common include file, based on the current object, for example.

  • is_child_of( Mixed $object )Boolean

    A synonym for the WOOF::child_of, to checks if the current WordPress WOOF::object is a child of the given object.Note: this will only return meaningful results if the current object is a post or term (and the post type / taxonomy is hierarchical respectively).

  • is_false_arg( Array $args, String $key )Boolean

    Returns true if the value of the argument at the key provided is regarded as a false value, in the context of a set of arguments that would be parsed by wp_parse_args.

  • is_true_arg( Array $args, String $key )Boolean

    Returns true if the value of the argument at the key provided is regarded as a true value, in the context of a set of arguments that would be parsed by wp_parse_args.

  • mixin()

    A powerful method allowing developers to augment the classes in MEOW and WOOF with their own class functions, without needing to create class extensions of them.

  • modified( String $format = null )String OR Integer

    Gets the modified date of the current post.

  • object()Mixed

    Retrieves the active WordPress object, which is decided by analysing the current template being accessed.

  • object_type()String

    Returns a string representing the type of the the current WordPress object, which is decided by analysing the current template being accessed.

  • page_count()Integer

    Retrieves the total number of pages in the current listing, if that listing is paginated.

  • page_num()Integer

    A synonym of the WOOF::page_number to retrieve the current page number in a paginated listing of posts. Essentially a wrapper around retrieval of the global $paged property, but normalized to return 1 if that property is not set, or is 0.

  • page_number()Integer

    Retrieves the current page number in a paginated listing of posts. Essentially a wrapper around retrieval of the global $paged property, but normalized to return 1 if that property is not set, or is 0.

  • post_type()WOOF_PostType

    Return a WOOF_PostType for the current post.

  • qv( String $name )String

    A shorthand wrapper method for WordPress get_query_var function.

  • raw_content( Arguments $args = array() )String

    Returns the unfiltered content for the current post.

  • request( String $name )String

    A shorthand wrapper method for WordPress get_query_var function.

  • rpad( $str, String $char )

    Pads a string at the right with 1 character of your choosing, only if the string does not already have that character on the right. .

  • site( Integer $id = null )MEOW_Site

    Returns a WOOF_Site object representing the site for the given id, or the current site if the id is not provided, or we’re not in a multi-site environment. .

  • site_description()String

    Retrieves the description of the current site – essentially a wrapper for the WordPress function call get_bloginfo(“description”).

  • site_name()String

    Retrieves the name of the current site – essentially a wrapper for the WordPress function call get_bloginfo(“name”).

  • site_tagline()String

    Retrieves the tagline for the current site – essentially a wrapper for the WordPress function call get_bloginfo(“tagline”).

  • site_title()String

    A synonym for WOOF_Site::name to retrieves the name of the current site – essentially a wrapper for the WordPress function call get_bloginfo(“name”).

  • site_url( Boolean $roor_relative = false )String

    Retrieves the URL for the current site – essentially a wrapper for the WordPress function call get_bloginfo(“url”), with the option to make the URL root relative (exclude the domain and protocol).

  • the_site()MEOW_Site

    Retrieves a MEOW_Site object representing the current site – this method also works in non-multisite environments, to retrieve an object describing the site.

  • title()String

    Returns the title of the current WordPress WOOF::object.Note: This method will return a sensible value for each of the classes that represent a WordPress object, since they all provide their own implementation of a title method, which remaps to a sensible notion of “title” for that object.

  • wp_content_dir( Boolean $main = false )String

    A multi-site aware method for getting the current WordPress content directory.

  • wp_content_url( Boolean $main = false )String

    A multi-site aware method for getting the full wp-content URL for a given path relative to the wp-content directory. .

Conditional

  • is_front()Boolean

    Checks to see if you’re on the current front page via the WordPress is_front_page function.

  • is_front_or_home()Boolean

    Checks to see if this page is the front or home page, via a check on both is_front_page and is_home. .

  • is_home()Boolean

    Checks to see if the current page is the home page, via the WordPress is_home function.

  • is_page( Mixed $page )Boolean

    Checks to see if the current post / page is the page given in the page argument.

  • is_page_number( Integer $n )Boolean

    Checks to see if the current page number is the given page, via comparing with the result of calling page_num.

  • is_paged()Boolean

    Checks to see if the displayed posts are currently paged or not, that is, the visitor is currently on a page that is not the first in an archive of posts. .

  • is_template( Array / String $templates )Boolean

    Checks to see if the current template filename matches the provided file name or is one of a number of file names.

Theming

  • ancestors()WOOF_Collection of WOOF_Post OR WOOF_Collection of WOOF_Term

    Retrieves a collection of ancestors for the current WordPress WOOF::object, from lowest to highest in the hierarchyThis will only return meaningful results when the current object is a post or term.

  • attachment()WOOF_Attachment OR WOOF_Silent

    Retrieves a WOOF_Attachment object for the attachment with the given ID.

  • attachments( Array / String $args = array() )WOOF_Collection of WOOF_Attachment

    Retrieves a collection of attachment objects for the given query arguments. Note: The args parameter for this method is a preset for WordPress’ get_posts function that is forced to query for the attachment post_type.

  • author()WOOF_User

    Returns either the author for the current post if the current WordPress WOOF::object is a post, or the current logged in user otherwise.

  • category( String $slug = null )WOOF_Term OR WOOF_Silent

    Retrieves a WOOF_Term object for the given category slug, if it exists.Note: if the $slug argument is not provided, this method will attempt to return the current category (if any). .

  • child_of( Mixed $object )Boolean

    Checks if the current WordPress WOOF::object is a child of the given object / object id, or object slug. Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively). .

  • child_theme_url( String $file, Boolean $timestamp = true, Boolean $root_relative = true )String

    A preset on the WOOF::theme_url to returns a URL to a file or folder within the directory of the active theme, but forced to regard only the child theme folder.

  • children( Arguments $args = array() )WOOF_Collection of WOOF_Post OR WOOF_Collection of WOOF_Term OR WOOF_Collection

    Retrieves the immediate child objects of the current WordPress WOOF::object.This method uses get_posts or get_terms to retrieve the children, and you can further clarify this query with the args parameter (the parent parameter will be enforced to actually retrieve the children). Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively).

  • comments_count()Integer

    Returns the integer count of comments for the current post.This is simply an alternative syntax for WordPress’ get_comments_number function.

  • comments_number( String $zero = "", String $one = "", String $many = "" )String

    Returns a formatted string representing the count of comments for the current post.Note: All format strings are run through sprintf with the current comment count.

  • comments_open()Boolean

    Checks if comments are open for the current post.

  • comments_url( Boolean $root_relative = false )String

    Gets the comments URL for the current post.

  • content( Arguments $args = array() )String

    Returns the content for the current post.Note that part of the convenience of this function is that the MEOW API does not necessarily require “the loop” code to be wrapping it for the content to be actually output.

  • content_file( String $path, Boolean $main = "auto" )WOOF_File

    Retrieves a WOOF_File object representing a file at the path given (which is relative to the wp-content path).

  • content_image( String $path, Boolean $main = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given.

  • date( String $format = null )String OR Integer

    Gets the publish date of the current post.

  • excerpt( Arguments $args = array() )String

    Generate an excerpt for the current post, or get the manual excerpt, depending on the args provided.

  • script( Array / String $ids )

    A shorthand version of the WordPress function wp_enqueue_script which will enqueue one or more registered scripts, via the $ids argument, which can be a single identifier, a CSV string of identifiers, or an array of identifiers.Note: this method does not accept a second argument for the URL to the script, it is purely a shorthand for enqueuing scripts registered by WordPress or other themes.

  • style( Array / String $ids )

    A shorthand version of the WordPress function wp_enqueue_style which will enqueue one or more registered stylesheets, via the $ids argument, which can be a single identifier, a CSV string of identifiers, or an array of identifiers.Note: this method does not accept a second argument for the URL to the stylesheet, it is purely a shorthand for enqueuing stylesheets registered by WordPress or other themes.

Posts

Pages

Attachments

Traversal

  • children( Arguments $args = array() )WOOF_Collection of WOOF_Post OR WOOF_Collection of WOOF_Term OR WOOF_Collection

    Retrieves the immediate child objects of the current WordPress WOOF::object.This method uses get_posts or get_terms to retrieve the children, and you can further clarify this query with the args parameter (the parent parameter will be enforced to actually retrieve the children). Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively).

  • has_children()Boolean

    Checks if the current WordPress WOOF::object has any children.Note: this will only return meaningful results if the current object is a post or term (and the post type / taxonomy is hierarchical respectively).

  • has_parent()Boolean

    Checks if the current WordPress WOOF::object has a parent.Note: this will only return meaningful results if the current object is a post or term (and the post type / taxonomy is hierarchical respectively).

Comments

Taxonomy Terms

  • has_parent()Boolean

    Checks if the current WordPress WOOF::object has a parent.Note: this will only return meaningful results if the current object is a post or term (and the post type / taxonomy is hierarchical respectively).

  • parent()MEOW_Post OR

    Retrieves the immediate parent object of the current WordPress WOOF::object.Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively).

  • slug()String

    Retrieves the slug for the current WordPress WOOF::object.Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively).

  • tag( String $slug = null )WOOF_Term OR WOOF_Silent

    Retrieves a WOOF_Term object for a given tag (a term within the built-in taxonomy “post_tag”).Note: if the $slug argument is not provided, this method will return the current tag (if any).

  • term( Mixed $id = null, String $taxonomy = null ) OR WOOF_Silent

    Retrieves a MEOW_Term object for the given id and taxonomy arguments.

  • term_by_id( Integer $id ) OR WOOF_Silent

    Retrieves a MEOW_Term object, by a specific term (database) ID.

  • term_by_name( String $name ) OR WOOF_Silent

    Retrieves a MEOW_Term object, by a specific (descriptive) name and taxonomy.

  • term_by_slug( String $name ) OR WOOF_Silent

    Retrieves a MEOW_Term object, by a specific URL slug and taxonomy.

  • terms( String $taxonomy, Arguments $args )WOOF_Collection of

    A wrapper around the WordPress function get_terms to retrieve a collection of WOOF_Term objects for the given taxonomy and arguments. .

  • terms_by_id( Array / String $ids, String $taxonomy = null )WOOF_Collection of

    Retrieves a collection of MEOW_Term objects for the given ids and optionally a taxonomy.

  • the_category() OR WOOF_Silent

    A preset on the WOOF::the_term method, to retrieve the current active category (if any).Note that this method uses “category” for the $taxonomy argument of WOOF::the_term, which means that a silent object will be returned if there is no active category, or the active term is from another taxonomy (such as a tag). .

  • the_tag() OR WOOF_Silent

    A preset on the WOOF::the_term method, to retrieve the current active post tag (if any).Note that this method uses “post_tag” for the $taxonomy argument of WOOF::the_term, which means that a silent object will be returned if there is no active tag, or the active term is from another taxonomy (such as a category). .

  • the_term( String $taxonomy = null ) OR WOOF_Silent

    Retrieves a meow-taxonomy object for the current taxonomy term being displayed.

  • title()String

    Returns the title of the current WordPress WOOF::object.Note: This method will return a sensible value for each of the classes that represent a WordPress object, since they all provide their own implementation of a title method, which remaps to a sensible notion of “title” for that object.

  • top()MEOW_Post OR OR Mixed

    Retrieves the top level ancestor of the current WordPress WOOF::object.Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively), otherwise the current WordPress object will simply be returned.

  • wrap_term( Object $term )

    Wraps a term result as would be returned by get_term, for example, as a MEOW_Term object.

  • wrap_terms( Object $term )WOOF_Collection of

    Wraps an array of term results as would be returned by get_terms, for example, as a collection of MEOW_Term objects.

Files

  • child_theme_file( String $path )WOOF_File

    A preset on the WOOF::theme_file method to retrieve a WOOF_File object representing a file at the path given, relative to the directory of the child theme.

  • child_theme_image( $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the child theme directory of the active theme appended to a default base directory of “images” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • child_theme_img( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the child theme directory of the active theme appended to a default base directory of “img” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • content_file( String $path, Boolean $main = "auto" )WOOF_File

    Retrieves a WOOF_File object representing a file at the path given (which is relative to the wp-content path).

  • content_image( String $path, Boolean $main = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given.

  • content_url( String $file = "", Boolean $timestamp = true, Boolean $root_relative = true, Boolean $main = false )String

    Retrieves the URL for a given file path relative to the wp-content directory, or a directory inside blogs.dir for multisite.

  • file_from_url( String $url, String $name = "", String $dir = "", String $assume_extension = "txt" )WOOF_File OR WOOF_Silent

    Downloads a file from the given URL if it has not been downloaded before, caches it to a directory specified, and returns a file object representing it.

  • parent_theme_file( String $path )

    A preset on the WOOF::theme_file method to retrieve a WOOF_File object representing a file at the path given, relative to the directory of the parent theme.

  • parent_theme_image( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the parent theme directory of the active theme appended to a default base directory of “images” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • parent_theme_img( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the parent theme directory of the active theme, appended to a default base directory of “img” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • theme_file( $path, Boolean $parent = "auto" )WOOF_File

    Retrieves a WOOF_File object representing a file at the path given, relative to the directory of the active theme.

  • theme_image( String $path, String $base_dir = "images", Boolean $parent = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given, relative to the directory of the active theme appended to a default base directory of “images” inside your theme. This method is also child-theme aware, in that it is configured by default to first look for the image file in an active child-theme, and if not found there will then look in the parent theme.

  • theme_img( String $path, String $base_dir = "images", Boolean $parent = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given, relative to the directory of the active theme appended to a default base directory of “img” inside your theme. This method is also child-theme aware, in that it is configured by default to first look for the image file in an active child-theme, and if not found there will then look in the parent theme.

  • uploaded_file( String $path )WOOF_File

    Retrieves a WOOF_File object representing a file at the given path relative to the WordPress upload directory.

  • uploaded_image( String $path )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the given path relative to the WordPress upload directory.

Images

  • child_theme_image( $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the child theme directory of the active theme appended to a default base directory of “images” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • child_theme_img( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the child theme directory of the active theme appended to a default base directory of “img” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • content_image( String $path, Boolean $main = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given.

  • image_from_url( String $url, String $name = "", String $dir = "", String $assume_extension = "txt" )WOOF_Image OR WOOF_Silent

    Downloads an image file from the given URL if it has not been downloaded before, caches it to a directory specified, and returns an image file object representing it.

  • parent_theme_image( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the parent theme directory of the active theme appended to a default base directory of “images” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • parent_theme_img( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the parent theme directory of the active theme, appended to a default base directory of “img” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • theme_image( String $path, String $base_dir = "images", Boolean $parent = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given, relative to the directory of the active theme appended to a default base directory of “images” inside your theme. This method is also child-theme aware, in that it is configured by default to first look for the image file in an active child-theme, and if not found there will then look in the parent theme.

  • theme_img( String $path, String $base_dir = "images", Boolean $parent = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given, relative to the directory of the active theme appended to a default base directory of “img” inside your theme. This method is also child-theme aware, in that it is configured by default to first look for the image file in an active child-theme, and if not found there will then look in the parent theme.

  • uploaded_image( String $path )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the given path relative to the WordPress upload directory.

Users

Post Types

Taxonomies

URL Handling

  • child_theme_url( String $file, Boolean $timestamp = true, Boolean $root_relative = true )String

    A preset on the WOOF::theme_url to returns a URL to a file or folder within the directory of the active theme, but forced to regard only the child theme folder.

  • current_url()String

    Returns the current URL derived from PHP server variables.

  • has_qv( String $name )Boolean

    Checks if the current WordPress query has a variable for the given name, via WordPress get_query_var function.

  • has_request()Boolean

    A synonym for the has_qv method to check if the current WordPress query has a variable for the given name, via WordPress get_query_var function.

  • parent_theme_url( String $file, Boolean $timestamp = true, Boolean $root_relative = true )String

    A preset on the WOOF::theme_url to return a URL to a file or folder within the directory of the active theme, but forced to regard only the parent theme folder.

  • theme_absolute_url( String $file, Boolean $timestamp = true )String

    Returns the absolute URL of a file or folder within the directory of the active theme.Note: this method does not check that the file or directory exists.

  • theme_url( String $file, Boolean $timestamp = true, Boolean $root_relative = true, Boolean $parent = "auto" )String

    Returns a URL to a file or folder within the directory of the active theme.

  • url( Boolean $root_relative = true )String

    Returns the URL of the current WordPress WOOF::object, or the current URL derived from server variables if there is no current object.

  • urlencode( Boolean $root_relative = false )String

    Returns the encoded URL for the current WordPress WOOF::object, or the current URL derived from server variables if there is no current object.

Templates

Themes

  • body_attr( Array $class = array(), String $id = "" )String

    A similar function to WordPress’ body_class function, which can combine the values of WOOF::body_id and WOOF::body_class together to populate a class and ID combo for the HTML body tag.

  • body_class( Array / String $class = array() )String

    A replacement function for WordPress body_class function that can regard the value of a $body_class global, in addition to merging in the standard values from get_body_class.

  • body_id( String $body_id = "" )String

    A companion function for WordPress body_class or the WOOF::body_class method to output an attribute for the ID of the body tag.

  • child_theme_file( String $path )WOOF_File

    A preset on the WOOF::theme_file method to retrieve a WOOF_File object representing a file at the path given, relative to the directory of the child theme.

  • child_theme_image( $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the child theme directory of the active theme appended to a default base directory of “images” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • child_theme_img( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the child theme directory of the active theme appended to a default base directory of “img” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • do_enqueue_theme_script( String $base, Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    A wrapper for wp_enqueue_script which can enqueue more than one stylesheet in your theme at once from a given base directory.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • do_enqueue_theme_style( String $base, Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once from a given base directory, relative to your theme directory.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • enqueue_theme_css( Array / String $files, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/css.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • enqueue_theme_javascript( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    A wrapper for wp_enqueue_script which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/javascripts.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • enqueue_theme_javascript_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/javascripts.

  • enqueue_theme_js( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, Boolean $root_relative = true, String $default_extension = "js", String $parent = "auto" )

    A wrapper for wp_enqueue_script which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/js.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • enqueue_theme_js_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/js.

  • enqueue_theme_script( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    A wrapper for wp_enqueue_script which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/script.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • enqueue_theme_script_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/script.

  • enqueue_theme_style( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can more simply enqueue the standard style.css in your theme and assumes a base folder of THEME_DIR.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • enqueue_theme_stylesheet( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/stylesheets.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • parent_theme_file( String $path )

    A preset on the WOOF::theme_file method to retrieve a WOOF_File object representing a file at the path given, relative to the directory of the parent theme.

  • parent_theme_image( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the parent theme directory of the active theme appended to a default base directory of “images” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • parent_theme_img( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the parent theme directory of the active theme, appended to a default base directory of “img” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • parent_theme_url( String $file, Boolean $timestamp = true, Boolean $root_relative = true )String

    A preset on the WOOF::theme_url to return a URL to a file or folder within the directory of the active theme, but forced to regard only the parent theme folder.

  • theme_absolute_url( String $file, Boolean $timestamp = true )String

    Returns the absolute URL of a file or folder within the directory of the active theme.Note: this method does not check that the file or directory exists.

  • theme_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    An alias for WOOF::enqueue_theme_css which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/css.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_file( $path, Boolean $parent = "auto" )WOOF_File

    Retrieves a WOOF_File object representing a file at the path given, relative to the directory of the active theme.

  • theme_image( String $path, String $base_dir = "images", Boolean $parent = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given, relative to the directory of the active theme appended to a default base directory of “images” inside your theme. This method is also child-theme aware, in that it is configured by default to first look for the image file in an active child-theme, and if not found there will then look in the parent theme.

  • theme_img( String $path, String $base_dir = "images", Boolean $parent = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given, relative to the directory of the active theme appended to a default base directory of “img” inside your theme. This method is also child-theme aware, in that it is configured by default to first look for the image file in an active child-theme, and if not found there will then look in the parent theme.

  • theme_javascript( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    An alias for the WOOF::enqueue_theme_javascript method which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/javascripts.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_javascript_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/javascripts.

  • theme_js( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    An alias for the WOOF::enqueue_theme_js method which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/js.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_js_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    An alias for the WOOF::enqueue_theme_js_css method which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/js.

  • theme_script( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    An alias for the WOOF::enqueue_theme_js method which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/scripts.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_script_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/script.

  • theme_style( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    An alias for the WOOF::enqueue_theme_style method, which can more simply enqueue the standard style.css in your theme and assumes a base folder of THEME_DIR.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_stylesheet( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    An alias for WOOF::enqueue_theme_stylesheet which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/stylesheets.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_url( String $file, Boolean $timestamp = true, Boolean $root_relative = true, Boolean $parent = "auto" )String

    Returns a URL to a file or folder within the directory of the active theme.

Transients API

Utility

Multi-Site

Internal Use

  • do_content_file( String $path, Boolean $main = "auto", String $type = "file" )WOOF_File OR WOOF_Image

    An internal function that allows common code to be used for the content_file and content_image methods. .

  • do_file_from_url( String $url, String $name = "", String $dir = "", String $assume_extension = "txt", String $default_dir, String $type )WOOF_File OR WOOF_Image

    An internal function that allows common code to be used for the file_from_url and image_from_url methods.

  • eval_expression( String $expression, WOOF_Wrap $object )String

    Evaluates an expression on a context object to a string result.

  • eval_token( String $token, WOOF_Wrap $object )String

    Evaluates a token part of an expression evaluated by WOOF::eval_expression method.

  • incl_phpquery()

    Includes the phpQuery library.

  • object_type()String

    Returns a string representing the type of the the current WordPress object, which is decided by analysing the current template being accessed.

  • pargs( Arguments $args )Array

    A utility function which defines a baseline of default settings for post query methods in the WOOF class, while also patching the standard arguments for ease of use, specifically:The default args are: array(“post_type” => “any”, “posts_per_page” => “-1”)If posts_per_page is set, but not numberposts, numberposts will be set to the value of posts_per_page, which smooths over a quirk in the standard query arguments.Note: this method is intended for internal use.

  • parse_query()

    An internal filter function used by MasterPress to augment the standard arguments available to WordPress post queries.

  • parse_term_composite( String $$id )Array

    An internal function used to extract the taxonomy and term from a composite string pair “taxonomy_name:term_id”. .

  • remap_args( Arguments $args, Array $aliases )Array

    Remaps the properties of an arguments array compatible with wp_parse_args to the correct argument keys accepted by another method, as defined in the second argument $aliases.This method is used internally by the update methods in WOOF_Post and WOOF_Term.

  • remember()

    An internal function used by MasterPress to retain the post object for the current post (if any).

  • wrap_object( $item, $class )Mixed

    A utility method used by the other wrap functions to wrap a stdClass object as an object specific to this API.

  • wrap_objects( Array $items, String $item_class, $collection_class = WOOF_Collection )WOOF_Collection of Mixed

    A utility method used by the other wrap functions to wrap an array of stdClass objects as a collection of objects specific to this API.

  • __call( String $name, Array $arguments )Mixed OR WOOF_Silent

    Implements PHP’s __call magic method to provide a number of clever handlers for the unknown method call.

  • __get( String $name )Mixed OR WOOF_Silent

    Implements PHP’s __get magic method to provides a number of clever handlers for the unknown property access.

  • ancestors()WOOF_Collection of WOOF_Post OR WOOF_Collection of WOOF_Term

    Retrieves a collection of ancestors for the current WordPress WOOF::object, from lowest to highest in the hierarchyThis will only return meaningful results when the current object is a post or term.

  • array_dim( Array $array )Integer

    Returns the dimensionality of the supplied array.

  • array_remove( Array $array, Mixed $value, Boolean $strict = false )Array

    Removes a value from the specified array, if it exists.

  • array_remove_keys( Array $array, Array $keys = array() )

    Removes (unsets) the values in an array indexed by the keys provided.

  • attachment()WOOF_Attachment OR WOOF_Silent

    Retrieves a WOOF_Attachment object for the attachment with the given ID.

  • attachments( Array / String $args = array() )WOOF_Collection of WOOF_Attachment

    Retrieves a collection of attachment objects for the given query arguments. Note: The args parameter for this method is a preset for WordPress’ get_posts function that is forced to query for the attachment post_type.

  • author()WOOF_User

    Returns either the author for the current post if the current WordPress WOOF::object is a post, or the current logged in user otherwise.

  • body_attr( Array $class = array(), String $id = "" )String

    A similar function to WordPress’ body_class function, which can combine the values of WOOF::body_id and WOOF::body_class together to populate a class and ID combo for the HTML body tag.

  • body_class( Array / String $class = array() )String

    A replacement function for WordPress body_class function that can regard the value of a $body_class global, in addition to merging in the standard values from get_body_class.

  • body_id( String $body_id = "" )String

    A companion function for WordPress body_class or the WOOF::body_class method to output an attribute for the ID of the body tag.

  • cache( String $name, Mixed $value = null, Integer $expires = 600, Boolean $json = false )Mixed OR Boolean

    An more concise API terminology for the WordPress Transients API to retrieve OR store a value in a transient for a given amount of time.

  • category( String $slug = null )WOOF_Term OR WOOF_Silent

    Retrieves a WOOF_Term object for the given category slug, if it exists.Note: if the $slug argument is not provided, this method will attempt to return the current category (if any). .

  • child_of( Mixed $object )Boolean

    Checks if the current WordPress WOOF::object is a child of the given object / object id, or object slug. Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively). .

  • child_theme_file( String $path )WOOF_File

    A preset on the WOOF::theme_file method to retrieve a WOOF_File object representing a file at the path given, relative to the directory of the child theme.

  • child_theme_image( $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the child theme directory of the active theme appended to a default base directory of “images” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • child_theme_img( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the child theme directory of the active theme appended to a default base directory of “img” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • child_theme_url( String $file, Boolean $timestamp = true, Boolean $root_relative = true )String

    A preset on the WOOF::theme_url to returns a URL to a file or folder within the directory of the active theme, but forced to regard only the child theme folder.

  • children( Arguments $args = array() )WOOF_Collection of WOOF_Post OR WOOF_Collection of WOOF_Term OR WOOF_Collection

    Retrieves the immediate child objects of the current WordPress WOOF::object.This method uses get_posts or get_terms to retrieve the children, and you can further clarify this query with the args parameter (the parent parameter will be enforced to actually retrieve the children). Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively).

  • collection( Array $items = array() )WOOF_Collection

    Returns a new WOOF_Collection object, using the provided array to form the items in the collection.

  • comments( Arguments $args )WOOF_Collection of WOOF_Comment

    A wrapper method for WordPress’ get_comments function to retrieve a collection of WOOF_Comment objects for the given arguments.

  • comments_count()Integer

    Returns the integer count of comments for the current post.This is simply an alternative syntax for WordPress’ get_comments_number function.

  • comments_number( String $zero = "", String $one = "", String $many = "" )String

    Returns a formatted string representing the count of comments for the current post.Note: All format strings are run through sprintf with the current comment count.

  • comments_open()Boolean

    Checks if comments are open for the current post.

  • comments_url( Boolean $root_relative = false )String

    Gets the comments URL for the current post.

  • content( Arguments $args = array() )String

    Returns the content for the current post.Note that part of the convenience of this function is that the MEOW API does not necessarily require “the loop” code to be wrapping it for the content to be actually output.

  • content_file( String $path, Boolean $main = "auto" )WOOF_File

    Retrieves a WOOF_File object representing a file at the path given (which is relative to the wp-content path).

  • content_image( String $path, Boolean $main = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given.

  • content_url( String $file = "", Boolean $timestamp = true, Boolean $root_relative = true, Boolean $main = false )String

    Retrieves the URL for a given file path relative to the wp-content directory, or a directory inside blogs.dir for multisite.

  • current_url()String

    Returns the current URL derived from PHP server variables.

  • date( String $format = null )String OR Integer

    Gets the publish date of the current post.

  • date_format( String $format, Integer $timestamp = null )String

    An extension of PHP’s date function to format date timestamps.

  • do_content_file( String $path, Boolean $main = "auto", String $type = "file" )WOOF_File OR WOOF_Image

    An internal function that allows common code to be used for the content_file and content_image methods. .

  • do_enqueue_theme_script( String $base, Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    A wrapper for wp_enqueue_script which can enqueue more than one stylesheet in your theme at once from a given base directory.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • do_enqueue_theme_style( String $base, Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once from a given base directory, relative to your theme directory.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • do_file_from_url( String $url, String $name = "", String $dir = "", String $assume_extension = "txt", String $default_dir, String $type )WOOF_File OR WOOF_Image

    An internal function that allows common code to be used for the file_from_url and image_from_url methods.

  • domain_of_url( $input )String

    Extracts the full domain of a given URL.

  • echoif( Mixed $condition, Mixed $value )

    Conditionally echos a value if the condition passed evaluates to true (first checks if condition is set).

  • enqueue_theme_css( Array / String $files, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/css.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • enqueue_theme_javascript( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    A wrapper for wp_enqueue_script which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/javascripts.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • enqueue_theme_javascript_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/javascripts.

  • enqueue_theme_js( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, Boolean $root_relative = true, String $default_extension = "js", String $parent = "auto" )

    A wrapper for wp_enqueue_script which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/js.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • enqueue_theme_js_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/js.

  • enqueue_theme_script( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    A wrapper for wp_enqueue_script which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/script.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • enqueue_theme_script_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/script.

  • enqueue_theme_style( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can more simply enqueue the standard style.css in your theme and assumes a base folder of THEME_DIR.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • enqueue_theme_stylesheet( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/stylesheets.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • eval_expression( String $expression, WOOF_Wrap $object )String

    Evaluates an expression on a context object to a string result.

  • eval_token( String $token, WOOF_Wrap $object )String

    Evaluates a token part of an expression evaluated by WOOF::eval_expression method.

  • excerpt( Arguments $args = array() )String

    Generate an excerpt for the current post, or get the manual excerpt, depending on the args provided.

  • expr( WOOF_Wrap $object, String $expr, String $ret = "string" )WOOF_Expression

    Creates a new woof-expression object with the given base object, expression, and return type.

  • file_from_url( String $url, String $name = "", String $dir = "", String $assume_extension = "txt" )WOOF_File OR WOOF_Silent

    Downloads a file from the given URL if it has not been downloaded before, caches it to a directory specified, and returns a file object representing it.

  • format_date( String $format, Integer $timestamp = null )String

    A synonym of the [method cls=”woof” name=”date-format” method to format date timestamps.

  • fposts( Arguments $args )WOOF_Collection of WOOF_Post

    Retrieves a filtered collection of WOOF_Post objects, by calling the WOOF::posts method with suppress_filters turned off.

  • get_sites( Arguments $args = array() )Array

    Issue a query on the sites in your multisite network.Note: use the WOOF::sites method, which accepts the same arguments, to return a collection of WOOF_Site objects instead.

  • has_children()Boolean

    Checks if the current WordPress WOOF::object has any children.Note: this will only return meaningful results if the current object is a post or term (and the post type / taxonomy is hierarchical respectively).

  • has_parent()Boolean

    Checks if the current WordPress WOOF::object has a parent.Note: this will only return meaningful results if the current object is a post or term (and the post type / taxonomy is hierarchical respectively).

  • has_qv( String $name )Boolean

    Checks if the current WordPress query has a variable for the given name, via WordPress get_query_var function.

  • has_request()Boolean

    A synonym for the has_qv method to check if the current WordPress query has a variable for the given name, via WordPress get_query_var function.

  • hex_to_rgb( String $hex )Array

    Converts a 3 or 6 character hex value (with or without hash prefix) to an array of 3 integer values representing the Red, Green, and Blue, values (0 – 255).

  • id()Integer

    Returns the database id of the current WordPress WOOF::object. This method will likely be most useful when creating custom SQL queries. .

  • id_for_slug( String $slug, String $type = post )Integer OR Boolean

    Returns the post ID for a given slug name and post type, if found.

  • image_from_url( String $url, String $name = "", String $dir = "", String $assume_extension = "txt" )WOOF_Image OR WOOF_Silent

    Downloads an image file from the given URL if it has not been downloaded before, caches it to a directory specified, and returns an image file object representing it.

  • incl_phpquery()

    Includes the phpQuery library.

  • is( Mixed $post, String $type = null )Boolean

    Checks if the current WordPress WOOF::object is the post specified by the parameters given. .

  • is_a( String $type )Boolean

    Checks if the current WordPress WOOF::object is of the given type.Type has different meanings depending on what the current object is:If the object is a post, type would be the name of a post typeIf the object is a term, type would be the name of a taxonomyIf the object is a user, type would be a user role This method would be useful to display different things in a common include file, based on the current object, for example.

  • is_an( String $type )Boolean

    A synonym for WOOF::is_a, to check if the current WordPress WOOF::object is of the given type.Type has different meanings depending on what the current object is:If the object is a post, type would be the name of a post typeIf the object is a term, type would be the name of a taxonomyIf the object is a user, type would be a user role This method would be useful to display different things in a common include file, based on the current object, for example.

  • is_assoc( Array $$arr )Boolean

    Evaluates to true if the argument supplied is an associative array.

  • is_child_of( Mixed $object )Boolean

    A synonym for the WOOF::child_of, to checks if the current WordPress WOOF::object is a child of the given object.Note: this will only return meaningful results if the current object is a post or term (and the post type / taxonomy is hierarchical respectively).

  • is_false_arg( Array $args, String $key )Boolean

    Returns true if the value of the argument at the key provided is regarded as a false value, in the context of a set of arguments that would be parsed by wp_parse_args.

  • is_front()Boolean

    Checks to see if you’re on the current front page via the WordPress is_front_page function.

  • is_front_or_home()Boolean

    Checks to see if this page is the front or home page, via a check on both is_front_page and is_home. .

  • is_home()Boolean

    Checks to see if the current page is the home page, via the WordPress is_home function.

  • is_page( Mixed $page )Boolean

    Checks to see if the current post / page is the page given in the page argument.

  • is_page_number( Integer $n )Boolean

    Checks to see if the current page number is the given page, via comparing with the result of calling page_num.

  • is_paged()Boolean

    Checks to see if the displayed posts are currently paged or not, that is, the visitor is currently on a page that is not the first in an archive of posts. .

  • is_template( Array / String $templates )Boolean

    Checks to see if the current template filename matches the provided file name or is one of a number of file names.

  • is_true_arg( Array $args, String $key )Boolean

    Returns true if the value of the argument at the key provided is regarded as a true value, in the context of a set of arguments that would be parsed by wp_parse_args.

  • items_number( Integer $count, String $zero, String $one, String $many )String

    A conditional output function for displaying a count of items.

  • json_get( String $url, Boolean $assoc = false, String $cache = false, Object $req = null )Object OR Array OR Array OR Boolean

    Retrieves a json object or associative array by requesting a JSON string from a remote URL and decoding it.

  • json_indent()String

    Formats a JSON object string with indenting for enhanced readability.

  • json_uncache( String $url )

    Uncaches a JSON string that was previously cached by the WOOF::json_get. .

  • latest( Integer $count = 1, Arguments $args = array() )MEOW_Post OR WOOF_Collection of MEOW_Post

    Returns objects for the latest 1 or more posts, based on a query with the arguments provided.

  • loop()WOOF_Collection of WOOF_Post

    An alternative syntax for running The Loop in WordPress, i.e.

  • lpad( String $str, String $chr )String

    Pads a string with 1 character of your choosing, only if the string does not already have that character on the left. .

  • mixin()

    A powerful method allowing developers to augment the classes in MEOW and WOOF with their own class functions, without needing to create class extensions of them.

  • modified( String $format = null )String OR Integer

    Gets the modified date of the current post.

  • nl2( String $string, String $tag = p, Boolean $line_breaks = false, Boolean $xml = true )String

    Converts a newline-formatted string into a string that is broken into blocks wrapped by the specified tag.

  • nl2p( String $string, Boolean $line_breaks = false, Boolean $xml = true )String

    Converts a newline-formatted HTML string to a paragraph-formatted string.

  • object()Mixed

    Retrieves the active WordPress object, which is decided by analysing the current template being accessed.

  • object_type()String

    Returns a string representing the type of the the current WordPress object, which is decided by analysing the current template being accessed.

  • pad( String $str, String $chr )String

    Pads a character to the left and right of the provided string, but only if the specified character is not already present at the left and right respectively.

  • page( Mixed $id )WOOF_Post OR WOOF_Silent

    A synonym for the WOOF::post method to return a WOOF_Post object for the given id argument.

  • page_by_path( String $path )MEOW_Post OR WOOF_Silent

    A preset of the post-by method, to retrieve a page by a full slug path.

  • page_count()Integer

    Retrieves the total number of pages in the current listing, if that listing is paginated.

  • page_num()Integer

    A synonym of the WOOF::page_number to retrieve the current page number in a paginated listing of posts. Essentially a wrapper around retrieval of the global $paged property, but normalized to return 1 if that property is not set, or is 0.

  • page_number()Integer

    Retrieves the current page number in a paginated listing of posts. Essentially a wrapper around retrieval of the global $paged property, but normalized to return 1 if that property is not set, or is 0.

  • pages( Arguments $args = array() )WOOF_Collection of MEOW_Post

    A wrapper around WordPress’ get_pages method to retrieve a collection of MEOW_Post objects matching the args provided.Note that this function is not merely a simple synonym of WOOF::posts since get_pages supports more functionality than get_posts.

  • pagination( Arguments $args = array() )String

    Outputs HTML pagination code for an archive listing page.Important Note: This method requires an active global query with the posts_per_page argument set to a value that is not -1.

  • parent()MEOW_Post OR

    Retrieves the immediate parent object of the current WordPress WOOF::object.Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively).

  • parent_theme_file( String $path )

    A preset on the WOOF::theme_file method to retrieve a WOOF_File object representing a file at the path given, relative to the directory of the parent theme.

  • parent_theme_image( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the parent theme directory of the active theme appended to a default base directory of “images” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • parent_theme_img( String $path, String $base_dir = "images" )WOOF_Image

    A preset on the WOOF::theme_image to return a WOOF_Image object representing an image file at the path given, relative to the parent theme directory of the active theme, appended to a default base directory of “img” inside your theme. This can be really useful for displaying images stored inside your theme folder, opening up the rich image processing API of the WOOF_Image object to those images. .

  • parent_theme_url( String $file, Boolean $timestamp = true, Boolean $root_relative = true )String

    A preset on the WOOF::theme_url to return a URL to a file or folder within the directory of the active theme, but forced to regard only the parent theme folder.

  • pargs( Arguments $args )Array

    A utility function which defines a baseline of default settings for post query methods in the WOOF class, while also patching the standard arguments for ease of use, specifically:The default args are: array(“post_type” => “any”, “posts_per_page” => “-1”)If posts_per_page is set, but not numberposts, numberposts will be set to the value of posts_per_page, which smooths over a quirk in the standard query arguments.Note: this method is intended for internal use.

  • parse_query()

    An internal filter function used by MasterPress to augment the standard arguments available to WordPress post queries.

  • parse_term_composite( String $$id )Array

    An internal function used to extract the taxonomy and term from a composite string pair “taxonomy_name:term_id”. .

  • post( Mixed $id, String $type = post )WOOF_Post OR WOOF_Silent

    Retrieves a WOOF_Post object for the given id and type arguments.

  • post_type()WOOF_PostType

    Return a WOOF_PostType for the current post.

  • post_types( Array / String $arg )WOOF_PostType OR WOOF_Collection of WOOF_PostType OR WOOF_Silent

    Returns a single WOOF_PostType object representing a post type name in the $arg parameter, or multiple post types if the $arg parameter is an arguments array, as would be passed to the WordPress function get_post_types(). Note: if you do not pass any arguments to this method, a collection of all registered post types will be retrieved.

  • posts( Arguments $args )WOOF_Collection

    A wrapper around the WordPress function get_posts to retrieve a collection of WOOF_Post objects for the given arguments. .

  • posts_by_menu_order( Arguments $args = array() )WOOF_Collection

    A preset on the WOOF::posts method to retrieve a collection of WOOF_Post objects ordered by menu order (user defined order).

  • posts_by_title( Arguments $args = array() )WOOF_Collection

    A preset on the WOOF::posts method to retrieve a collection of WOOF_Post objects ordered by title.

  • posts_in( Array / String $ids, Arguments $args = array() )WOOF_Collection of MEOW_Post

    A preset on the WOOF::posts method to retrieve a collection of WOOF_Post objects with ids falling within the given set of ids, and matching the provided args.

  • posts_not_in( Array / String $ids, Arguments $args = array() )WOOF_Collection of MEOW_Post

    A preset on the WOOF::posts method to retrieve a collection of WOOF_Post objects with ids that do not fall within the given set of ids, and matching the provided args.

  • prepare( String $str )String

    A shorthand wrapper method for the applying WordPress’ the_content filter to a string.

  • protect()

    Stores a pointer to the global $post object away so that you can use the variable name $post in your code elsewhere.

  • query_posts( Arguments $args )WOOF_Collection

    A wrapper around the WordPress function query_posts to alter the way WordPress displays posts at a given URL.

  • qv( String $name )String

    A shorthand wrapper method for WordPress get_query_var function.

  • raw_content( Arguments $args = array() )String

    Returns the unfiltered content for the current post.

  • release()

    Sets the global $post variable back to its original value after WOOF::protect has been called (which allows a variable named $post to be used in your own code) .

  • remap_args( Arguments $args, Array $aliases )Array

    Remaps the properties of an arguments array compatible with wp_parse_args to the correct argument keys accepted by another method, as defined in the second argument $aliases.This method is used internally by the update methods in WOOF_Post and WOOF_Term.

  • remember()

    An internal function used by MasterPress to retain the post object for the current post (if any).

  • remote_get( String $url, Arguments $arguments = array() )WOOF_Request

    Retrieves a remote web page using the HTTP get method, via the WOOF_Request class, which is a wrapper for the WordPress HTTP API.Note: this method can also cache the result for a given amount of time, providing a very concise way to retrieve the content of another site or service in a performant manner.

  • remote_post( String $url, Arguments $arguments = array() )WOOF_Request

    Posts to a remote web page using the HTTP POST method, via the WOOF_Request class, which is a wrapper for the WordPress HTTP API.

  • render_template( String $tmpl, Array $data, Boolean $strip_whitespace = false )String

    Renders the supplied String template using the Mustache library with the given data. .

  • request( String $name )String

    A shorthand wrapper method for WordPress get_query_var function.

  • reset()

    A wrapper method for WordPress’ wp_reset_query function, which destroys the previous query used on a custom loop.

  • results_count()Integer

    Returns a count of posts for the current query, whether this is setup from the current URL, or from a custom query.

  • results_number( String $zero = "No Search Results", String $one = "%d Search Result", String $many = "%d Search Results" )String

    Returns a formatted string representing the count of posts in the current query.Note: All format strings are run through sprintf with the current results count.

  • rgb_to_hex( Integer $r, Integer $g, Integer $b )String

    Converts three Red, Green, Blue integers to the hex string representation (with leading hash). .

  • role()WOOF_Role OR WOOF_Silent

    Retrieves the role for the given id, where an id is like a slug for the role, for example “administrator”.

  • roles()WOOF_Collection of WOOF_Role

    Returns a collection of WOOF_Role objects representing all of the roles in the WordPress site.

  • root_relative_url( String $input )String

    Converts a URL in the current site to a root-relative URL – that is, a URL without protocol and host, beginning with a leading slash to denote the root level.

  • rpad( $str, String $char )

    Pads a string at the right with 1 character of your choosing, only if the string does not already have that character on the right. .

  • san( $val )String

    A wrapper for the WordPress function sanitize_title_with_dashes.

  • sanitize( $val )String

    A wrapper for the WordPress function sanitize_title_with_dashes.

  • script( Array / String $ids )

    A shorthand version of the WordPress function wp_enqueue_script which will enqueue one or more registered scripts, via the $ids argument, which can be a single identifier, a CSV string of identifiers, or an array of identifiers.Note: this method does not accept a second argument for the URL to the script, it is purely a shorthand for enqueuing scripts registered by WordPress or other themes.

  • seconds( String $duration )Integer

    A handy function to parse a time duration string into an integer number of seconds.

  • shortcode_id( Array $attr )Integer

    Parses attributes passed to a shortcode handler to retrieve an “id” for the shortcode, accepting the following styles of shortcode:[item 1] [item id=”1″]That is, if there are no named attributes, this function will assume the first attribute is the ID.

  • siblings( Boolean $include_this = false )WOOF_Collection of WOOF_Post OR WOOF_Collection of WOOF_Term OR WOOF_Collection

    Retrieves the sibling objects of the current WordPress WOOF::object, that is, objects that exist at the same level in the hierarchy as the current object.Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively).

  • site( Integer $id = null )MEOW_Site

    Returns a WOOF_Site object representing the site for the given id, or the current site if the id is not provided, or we’re not in a multi-site environment. .

  • site_description()String

    Retrieves the description of the current site – essentially a wrapper for the WordPress function call get_bloginfo(“description”).

  • site_name()String

    Retrieves the name of the current site – essentially a wrapper for the WordPress function call get_bloginfo(“name”).

  • site_tagline()String

    Retrieves the tagline for the current site – essentially a wrapper for the WordPress function call get_bloginfo(“tagline”).

  • site_title()String

    A synonym for WOOF_Site::name to retrieves the name of the current site – essentially a wrapper for the WordPress function call get_bloginfo(“name”).

  • site_url( Boolean $roor_relative = false )String

    Retrieves the URL for the current site – essentially a wrapper for the WordPress function call get_bloginfo(“url”), with the option to make the URL root relative (exclude the domain and protocol).

  • sites( Arguments $args = array() )WOOF_Collection of MEOW_Site

    Returns a collection of WOOF_Site objects representing all of the sites in the multi-site network, or a collection of one site if the current environment is not multi-site.

  • slug()String

    Retrieves the slug for the current WordPress WOOF::object.Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively).

  • style( Array / String $ids )

    A shorthand version of the WordPress function wp_enqueue_style which will enqueue one or more registered stylesheets, via the $ids argument, which can be a single identifier, a CSV string of identifiers, or an array of identifiers.Note: this method does not accept a second argument for the URL to the stylesheet, it is purely a shorthand for enqueuing stylesheets registered by WordPress or other themes.

  • tag( String $slug = null )WOOF_Term OR WOOF_Silent

    Retrieves a WOOF_Term object for a given tag (a term within the built-in taxonomy “post_tag”).Note: if the $slug argument is not provided, this method will return the current tag (if any).

  • taxonomies( Arguments $args = array(), String $operator = "and" )WOOF_Collection of WOOF_Taxonomy

    A wrapper around the WordPress function get_taxonomies to retrieve a collection of WOOF_Taxonomy objects for the given arguments. .

  • taxonomies_for_type( String $type_name )WOOF_Collection of WOOF_Taxonomy

    Retrieves a collection of WOOF_Taxonomy objects which are assigned to the given (post) type name.

  • taxonomy( $name )WOOF_Taxonomy OR WOOF_Silent

    Retrieves a WOOF_Taxonomy object for the taxonomy with the given name, or a silent object if the taxonomy doesn’t exist.

  • template()String

    Returns the file name of the current template, sans-extension.

  • template_basename( String $suffix = "" )String

    Returns the filename of the current template, with or without the extension.

  • template_for_post( Mixed $post )String

    Retrieves the full filename (including extension) of the template currently being used for the given post.

  • template_path()String

    Returns the full path to the current template being used, derived by calling the WordPress function get_page_template.

  • term( Mixed $id = null, String $taxonomy = null ) OR WOOF_Silent

    Retrieves a MEOW_Term object for the given id and taxonomy arguments.

  • term_by_id( Integer $id ) OR WOOF_Silent

    Retrieves a MEOW_Term object, by a specific term (database) ID.

  • term_by_name( String $name ) OR WOOF_Silent

    Retrieves a MEOW_Term object, by a specific (descriptive) name and taxonomy.

  • term_by_slug( String $name ) OR WOOF_Silent

    Retrieves a MEOW_Term object, by a specific URL slug and taxonomy.

  • terms( String $taxonomy, Arguments $args )WOOF_Collection of

    A wrapper around the WordPress function get_terms to retrieve a collection of WOOF_Term objects for the given taxonomy and arguments. .

  • terms_by_id( Array / String $ids, String $taxonomy = null )WOOF_Collection of

    Retrieves a collection of MEOW_Term objects for the given ids and optionally a taxonomy.

  • the()MEOW_Post OR WOOF_Silent

    An highly useful method which retrieves a MEOW_Post object for the current post, based on wrapping the WordPress global $post variable. This is an important method, which is particularly useful in the following scenarios:Retrieving an object for the current post in a single post template (without necessarily requiring any The Loop code)Retrieving the current post in a standard The Loop in WordPress.

  • the_author()MEOW_User OR WOOF_Silent

    Returns a WOOF_User object for the current author.

  • the_category() OR WOOF_Silent

    A preset on the WOOF::the_term method, to retrieve the current active category (if any).Note that this method uses “category” for the $taxonomy argument of WOOF::the_term, which means that a silent object will be returned if there is no active category, or the active term is from another taxonomy (such as a tag). .

  • the_site()MEOW_Site

    Retrieves a MEOW_Site object representing the current site – this method also works in non-multisite environments, to retrieve an object describing the site.

  • the_tag() OR WOOF_Silent

    A preset on the WOOF::the_term method, to retrieve the current active post tag (if any).Note that this method uses “post_tag” for the $taxonomy argument of WOOF::the_term, which means that a silent object will be returned if there is no active tag, or the active term is from another taxonomy (such as a category). .

  • the_taxonomy()WOOF_Taxonomy OR WOOF_Silent

    Retrieves a WOOF_Taxonomy object for the current taxonomy being displayed.

  • the_term( String $taxonomy = null ) OR WOOF_Silent

    Retrieves a meow-taxonomy object for the current taxonomy term being displayed.

  • the_type()WOOF_PostType

    Retrieves a WOOF_PostType object for the current post type being displayed.

  • the_user()MEOW_User OR WOOF_Silent

    Retrieves a MEOW_User object representing the current logged in user, or a silent object if no-one is currently logged in. .

  • theme_absolute_url( String $file, Boolean $timestamp = true )String

    Returns the absolute URL of a file or folder within the directory of the active theme.Note: this method does not check that the file or directory exists.

  • theme_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    An alias for WOOF::enqueue_theme_css which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/css.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_file( $path, Boolean $parent = "auto" )WOOF_File

    Retrieves a WOOF_File object representing a file at the path given, relative to the directory of the active theme.

  • theme_image( String $path, String $base_dir = "images", Boolean $parent = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given, relative to the directory of the active theme appended to a default base directory of “images” inside your theme. This method is also child-theme aware, in that it is configured by default to first look for the image file in an active child-theme, and if not found there will then look in the parent theme.

  • theme_img( String $path, String $base_dir = "images", Boolean $parent = "auto" )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the path given, relative to the directory of the active theme appended to a default base directory of “img” inside your theme. This method is also child-theme aware, in that it is configured by default to first look for the image file in an active child-theme, and if not found there will then look in the parent theme.

  • theme_javascript( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    An alias for the WOOF::enqueue_theme_javascript method which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/javascripts.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_javascript_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/javascripts.

  • theme_js( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    An alias for the WOOF::enqueue_theme_js method which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/js.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_js_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    An alias for the WOOF::enqueue_theme_js_css method which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/js.

  • theme_script( Array / String $files, Array $deps = array(), Boolean $in_footer = false, Boolean $timestamp = true, String $default_extension = "js", String $parent = "auto" )

    An alias for the WOOF::enqueue_theme_js method which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/scripts.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_script_css( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    A wrapper for wp_enqueue_style which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/script.

  • theme_style( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    An alias for the WOOF::enqueue_theme_style method, which can more simply enqueue the standard style.css in your theme and assumes a base folder of THEME_DIR.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_stylesheet( Array / String $file = style.css, Array $deps = array(), String $media = "all", Boolean $timestamp = true, String $default_extension = "css", String $parent = "auto" )

    An alias for WOOF::enqueue_theme_stylesheet which can enqueue more than one stylesheet in your theme at once and assumes a base folder of THEME_DIR/stylesheets.Note that this method runs all URLs through WOOF::theme_url which is child theme-aware, with the default setting being to look for files first in the child theme directory then the parent theme directory.Note: in the example, we show this called directly in the template file before the call to wp_head(), but you also make use of the wp_enqueue_scripts action to call these functions.

  • theme_url( String $file, Boolean $timestamp = true, Boolean $root_relative = true, Boolean $parent = "auto" )String

    Returns a URL to a file or folder within the directory of the active theme.

  • title()String

    Returns the title of the current WordPress WOOF::object.Note: This method will return a sensible value for each of the classes that represent a WordPress object, since they all provide their own implementation of a title method, which remaps to a sensible notion of “title” for that object.

  • top()MEOW_Post OR OR Mixed

    Retrieves the top level ancestor of the current WordPress WOOF::object.Note: this will only return meaningful results if the current object is a post or term (and the type / taxonomy is hierarchical respectively), otherwise the current WordPress object will simply be returned.

  • top_latest( Integer $count = 1, Arguments $args = array() )WOOF_Collection of MEOW_Post

    A preset on the WOOF::posts method to retrieve a collection of the latest $count top level WOOF_Post objects.

  • top_posts( Arguments $args = array() )WOOF_Collection of WOOF_Post

    A preset on the WOOF::posts method to retrieve a collection of the latest $count top level WOOF_Post objects.

  • truncate( Array / String $args )String

    A string truncation function that chops the String argument to the specified length, with various options to control where and if the truncation takes place.

  • truncate_advanced( String $string, Integer $length = 80, String $etc = ..., Boolean $break_words = false, Boolean $middle = false )String

    Performs the same truncation as the truncate function, but with traditional expanded function arguments.

  • truncate_basic( String $text, Integer $max_length, String $trailing )String

    A basic string truncation function that chops the String argument to the specified length, adding a trailing string at the end only if the string is longer than the specified max length.

  • type( Array / String $arg )WOOF_PostType OR WOOF_Collection of WOOF_PostType OR WOOF_Silent

    A synonym for the post_types method, to return a single WOOF_PostType object representing a post type name in the $arg parameter, or multiple post types if the $arg parameter is an arguments array, as would be passed to the WordPress function get_post_types().Note: For readability, the intention is that this method is usually used to retrieve a single type.

  • types( Array / String $arg )WOOF_PostType OR WOOF_Collection of WOOF_PostType OR WOOF_Silent

    A synonym for the WOOF::post_types method, to return a single WOOF_PostType object representing a post type name in the $arg parameter, or multiple post types if the $arg parameter is an arguments array, as would be passed to the WordPress function get_post_types().

  • uncache( String $name )

    An more concise API terminology for the WordPress Transients API to manually remove a transient for the given key.

  • uploaded_file( String $path )WOOF_File

    Retrieves a WOOF_File object representing a file at the given path relative to the WordPress upload directory.

  • uploaded_image( String $path )WOOF_Image

    Retrieves a WOOF_Image object representing an image file at the given path relative to the WordPress upload directory.

  • url( Boolean $root_relative = true )String

    Returns the URL of the current WordPress WOOF::object, or the current URL derived from server variables if there is no current object.

  • urlencode( Boolean $root_relative = false )String

    Returns the encoded URL for the current WordPress WOOF::object, or the current URL derived from server variables if there is no current object.

  • user( Mixed $id = null )MEOW_User OR WOOF_Silent

    Retrieves a MEOW_User object for the given id.

  • user_by_email( String $email )MEOW_User OR WOOF_Silent

    Retrieves a MEOW_User object for the given email address.

  • user_by_id( Integer $id )MEOW_User OR WOOF_Silent

    Retrieves a MEOW_User object for the given (database) id.

  • user_by_login( String $email )MEOW_User OR WOOF_Silent

    Retrieves a MEOW_User object for the given login username.

  • users( $args = array() )WOOF_Collection of MEOW_User

    A wrapper around the WordPress get_users function to retrieve a collection of MEOW_User objects, based on the arguments provided.

  • wp_content_dir( Boolean $main = false )String

    A multi-site aware method for getting the current WordPress content directory.

  • wp_content_url( Boolean $main = false )String

    A multi-site aware method for getting the full wp-content URL for a given path relative to the wp-content directory. .

  • wrap( Array $posts )WOOF_Collection of MEOW_Post

    Wraps the results returned by a standard WordPress posts query (via get_posts, for example).

  • wrap_attachment( Object $attachment )WOOF_Attachment

    Wraps a post result as would be returned by a standard WordPress posts query (via get_posts, for example) as a WOOF_Attachment object.

  • wrap_attachments( Array $attachments )WOOF_Collection of WOOF_Attachment

    Wraps an array of post results as would be returned by a standard WordPress posts query (via get_posts, for example) as a collection of WOOF_Attachment objects.

  • wrap_comment( Object $comment )WOOF_Comment

    Wraps a standard comment object as would be returned by get_comment as a WOOF_Comment object. .

  • wrap_comments( Array $comments )WOOF_Collection of WOOF_Comment

    Wraps an array of comment results as would be returned by get_comments as a collection of comment objects.

  • wrap_object( $item, $class )Mixed

    A utility method used by the other wrap functions to wrap a stdClass object as an object specific to this API.

  • wrap_objects( Array $items, String $item_class, $collection_class = WOOF_Collection )WOOF_Collection of Mixed

    A utility method used by the other wrap functions to wrap an array of stdClass objects as a collection of objects specific to this API.

  • wrap_post( Object $attachment )MEOW_Post

    Wraps a post result as would be returned by a standard WordPress posts query (via get_posts, for example) as a WOOF_Post object.

  • wrap_post_type( Object $post_type )WOOF_PostType

    Wraps a post type result as would be returned by get_post_type_object, for example, as a WOOF_PostType object.

  • wrap_post_types( Array $post_types )WOOF_Collection of WOOF_PostType

    Wraps an array of post type objects, as would be returned by get_post_types, as a collection of WOOF_PostType objects.

  • wrap_roles( Array $roles )WOOF_Collection of WOOF_Role

    Wraps an array of roles as stored in the wp_user_roles option, as a collection of role objects. .

  • wrap_site( $site )MEOW_Site

    Wraps a stdClass representation of a site as a MEOW_Site object.

  • wrap_sites( Array $sites )WOOF_Collection of MEOW_Site

    Wraps an array of results as would be returned by WOOF::get_sites as a collection of MEOW_Site objects. .

  • wrap_taxonomies( Array $taxomomies )WOOF_Collection of WOOF_Taxonomy

    Wraps an array of taxonomy results as would be returned by get_taxonomies as a collection of WOOF_Taxonomy objects.

  • wrap_taxonomy( Object $taxonomy )WOOF_Taxonomy

    Wraps a taxonomy object as would be returned by get_taxonomy as a WOOF_Taxonomy object.

  • wrap_term( Object $term )

    Wraps a term result as would be returned by get_term, for example, as a MEOW_Term object.

  • wrap_terms( Object $term )WOOF_Collection of

    Wraps an array of term results as would be returned by get_terms, for example, as a collection of MEOW_Term objects.

  • wrap_user( Object $user )MEOW_User

    Wraps a user result as would be returned by get_userdata, for example, as a WOOF_User object.

  • wrap_users( Array $users )WOOF_Collection of MEOW_User

    Wraps an array of user results as would be returned by get_users, for example, as a collection of WOOF_User objects.

Base Class Methods

View method list from the base class WOOF_Wrap.

Latest From the Blog

MasterPress 1.3.10 is now available

9th November 2023

MasterPress 1.3.10 is a feature and bugfix release. Workaround for fatal error introduced by changes to WordPress’ wpdb class in WordPress 6.4. Added actions to MPC files upload_field & WF image save_image functions.

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Three AM