lib/utilities.php

Show: PublicProtectedPrivateinherited
    Table of Contents
    Utility functions used by the Planet Foundation Theme
    Package
    ncp\wp\themes\planet_foundation  
    Since
    Planet Foundation 1.0.0  

    Functions

    functionpf_add_orbit_css() : void

    Adds css for orbit

    Orbit transition is now controlled with css. This adds the css that will contol the transition speed based on the parameter set in the theme customizer.
    functionpf_categories(string $prefix = "Posted in: ") : void

    Returns HTML for categories styled using Zurb Foundation's button groups

    Can be used at the bottom posts to show the categories the posts are in. Prints the output to UA
    Parameters
    NameTypeDescription
    $prefixstring

    String to prefix to category list

    Details
    Link
    Zurb's Foundation Button Groups  
    Since
    Planet Foundation 1.0.0  
    functionpf_get_first_image() : void

    Get first image in a post

    Attempts to find an image in the post content. Should be called within the loop.
    Details
    Returns
    string image enclosed in img tags  
    functionpf_get_header_url() : \Url

    Retrieves the url for the header image if there is one specified

    First looks for slideshow slide, then page/post header, then default. Returns null if none are found
    Returns
    TypeDescription
    \Urlof header image
    functionpf_get_the_author(string $prefix = 'Written by', string $format = 'short') : string

    Returns HTML properly structured so it can be recognized as an author by Google

    Parameters
    NameTypeDescription
    $prefixstring

    String to prefix to author info, default is 'Written by'

    $formatstring

    'short' is abbreviated for excerpts, otherwise a long version with pic and bio

    Returns
    TypeDescription
    stringHTML
    Details
    Since
    Planet Foundation 1.0.0  
    functionpf_get_the_date(string $prefix = 'Posted on', string $format = 'long') : string

    Returns HTML properly structured so it can be recognized as a date by Google

    Parameters
    NameTypeDescription
    $prefixstring

    String to prefix to date, default is 'Posted on'

    $formatstring

    'long' is like Monday, Feburary 18, 2012, otherwise 2/18/12

    Returns
    TypeDescription
    stringHTML
    Details
    Since
    Planet Foundation 1.0.0  
    functionpf_get_the_header() : null | string

    Retrieves html for header image

    Looks for the wpcf-header-image type on the post or page first. This custom type will allow authors to specify a header image to go with the post or page. If custom type is not found, returns header image specified as part of the theme options. If header not specified as part of them options, return null Will return html for a Foundation orbit slideshow on home page if such a slideshow is specified in the theme customizer.
    Returns
    TypeDescription
    null | stringNull if no header is found. html if header is found.
    Details
    See
    wp_make_link_relative()  
    See
    get_post()  
    See
    get_post_meta()  
    See
    get_header_image()  
    Since
    Planet Foundation 1.0.0  
    Uses
    To get the slideshow if configured  
    functionpf_get_the_slideshow() : null | string

    Retrieves html for a slideshow designed to be used on a page header

    Will examine the parameters specified in the theme customize section Slideshow. Returns html that is recognized by Zurb's Foundation Orbit javascript module. Will return null if no slides are found or slideshow is turned off. Child themes may completely override this using the filter pf_get_the_slideshow_override or modify the returned html using pf_get_the_slideshow_filter
    Returns
    TypeDescription
    null | stringNull if slideshow not configured. html if slideshow is turned on and slides specified.
    Details
    Link
    add_filter()  
    See
    get_theme_mod()  
    See
    apply_filters()  
    Since
    Planet Foundation 1.0.0  
    functionpf_remove_hentry_class(array $post_classes, string $additional_classes) : String

    Removes hentry class from Wordpress default post classes

    Some posts do not have all the required hentry sub-classes. If hentry is used in this scenario, Google's structured data checker shows errors
    Parameters
    NameTypeDescription
    $post_classesarray

    Array of classes

    $additional_classesstring

    Space separated string of addition classes to add

    Returns
    TypeDescription
    Stringof classes
    Details
    Since
    Planet Foundation 1.0.0  
    functionpf_show_author() : false | true

    Checks if author wants the author displayed as part of the page or post

    Returns
    TypeDescription
    false | true
    functionpf_show_tags() : false | true

    Checks if author wants the tags displayed as part of the page or post

    Returns
    TypeDescription
    false | true
    functionpf_show_title() : false | true

    Checks if author wants the title displayed as part of the page or post

    Returns
    TypeDescription
    false | true
    functionpf_tags(string $prefix = "Tags: ") : void

    Returns HTML for tags styled using Zurb Foundation's button groups

    Can be used at the bottom posts to show the tags the posts are in. Prints the output to UA
    Parameters
    NameTypeDescription
    $prefixstring

    String to prefix to category list

    Details
    Link
    Zurb's Foundation Button Groups  
    Since
    Planet Foundation 1.0.0  
    functionpf_the_nav_menu() : string

    Returns HTML for the main menu styled for Zurb Foundation's Top Bar module

    Returns
    TypeDescription
    stringHTML ready for placement as is in your template file
    Details
    Link
    Zurb's Foundation Top Bar  
    Since
    Planet Foundation 1.0.0  
    functionpf_the_page_menu() : string

    Returns HTML styled for Zurb Foundation's Off Canvas module.

    This implements the left and right sidebar as menus.
    Returns
    TypeDescription
    stringHTML ready for placement in template files
    Details
    Link
    Zurb's Foundation Off Canvas  
    See
    get_theme_mod()  
    See
    get_sidebar()  
    Since
    Planet Foundation 1.0.0  
    Documentation was generated by phpDocumentor 2.3.0 .