Follow

Pugpig Helper Functions

Pugpig has many helper functions that can help you improve your app.

pugpig_get_custom_field_manifest_item

Generate the text to add custom items to the manifest. This generates a string of text that can be add to the manifest using the hook pugpig_extra_manifest_items. For more on Pugpig Hooks see here.

$string = pugpig_get_custom_field_manifest_item($post, $field)

pugpig_strip_domain

Strip the domain off of any path. Pugpig requires that images and links have relative URLS. This generates a string of text.

$string = pugpig_strip_domanin($url)

pugpig_get_editions

Gets an array of editions. $status can have the values 'all', 'publish' or 'preview' (draft and pending editions).

$array = pugpig_get_editions($status)

pugpig_get_post_editions

Gets an array of editions that contain $post.

$array = pugpig_get_post_editions($post)

pugpig_get_edition_array

Gets an array of posts in $edition. Pugpig requires that images and links have relative URLS. This generates a string of text. The WordPress function get_post_custom() is used to get a list of all custom fields. pugpig_get_edition_array then sorts through this list. More about get_post_custom() can be found here.

$custom = get_post_custom($edition->ID);
$array = pugpig_get_edition_array($custom)

pugpig_get_taxonomy_name

Returns the taxonomy value set in Pugpig settings - either category or post_tag.

$string = pugpig_get_taxonomy_name()

pugpig_get_current_base_url

Returns current base URL.

$string = pugpig_get_current_base_url()

pugpig_self_link

Returns the URL of the page your on. 

$string = pugpig_self_link()

pugpig_get_authentication_secret

Returns the authentication secret set in your Pugpig settings. 

$string = pugpig_get_authentication_secret()

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk