2017 © Pedro Peláez
 

library plugin-templating-utils

Provides utility functions for templating functionality in plugins.

image

inpsyde/plugin-templating-utils

Provides utility functions for templating functionality in plugins.

  • Monday, April 16, 2018
  • by gmazzap
  • Repository
  • 4 Watchers
  • 5 Stars
  • 2,566 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 57 % Grown

The README.md

Plugin Templating Utils

A Composer package that provides utility functions to templating functionality in plugins.., (*1)


Functions

Inpsyde\plugin_file_base_dir()

Given a file a file inside a plugin directory, no matter how deep in the directory three, returns the absolute path to root directory of the plugin., (*2)

Inpsyde\plugin_template_part()

Similar to get_template_part() loads a template from a plugin directory. The plugin folder where to search is obtained from first argument, that can be a file in the target plugin directory, no matter how deep in the directory three., (*3)

Templates to be searched pass through 'plugin_template_part_templates' filter., (*4)

Inpsyde\find_plugin_template_part()

Similar to plugin_template_part() (also trigger same filter) it returns the path of found template instead of including it., (*5)

Inpsyde\plugin_file_path()

Similar to get_theme_file_path() returns the path of a file inside a plugin directory. The target plugin is obtained from first argument, that can be a file in the target plugin directory, no matter how deep in the directory three., (*6)

Returns empty string if the file does not exists., (*7)

Returned value passes through 'plugin_file_path' filter., (*8)

Inpsyde\plugin_file_uri()

Similar to get_theme_file_uri() returns the URL of a file inside a plugin directory. The target plugin is obtained from first argument, that can be a file in the target plugin directory, no matter how deep in the directory three., (*9)

Returns empty string if the file does not exists., (*10)

Returned value passes through 'plugin_file_uri' filter., (*11)

Inpsyde\plugin_template_part_fallback()

Like Inpsyde\plugin_template_part() but fallbacks to theme (or child theme) if file is not found in plugin., (*12)

Inpsyde\plugin_file_path_fallback()

Like Inpsyde\plugin_file_path() but fallbacks to theme (or child theme) if file is not found in plugin., (*13)

Inpsyde\plugin_file_uri_fallback()

Like Inpsyde\plugin_file_uri() but fallbacks to theme (or child theme) if file is not found in plugin., (*14)


Requirements

  • PHP 5.6+
  • Composer to install

Installation

Via Composer, package name is inpsyde/plugin-templating-utils., (*15)


Copyright (c) 2017 Inpsyde GmbH., (*16)

"Plugin Templating Utils" code is licensed under MIT license., (*17)

The team at Inpsyde is engineering the Web since 2006., (*18)

The Versions

16/04 2018

dev-master

9999999-dev

Provides utility functions for templating functionality in plugins.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

16/04 2018

0.2.1

0.2.1.0

Provides utility functions for templating functionality in plugins.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

03/11 2017

0.2.0

0.2.0.0

Provides utility functions for templating functionality in plugins.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

24/07 2017

0.1.0

0.1.0.0

Provides utility functions for templating functionality in plugins.

  Sources   Download

MIT

The Requires

  • php >=5.6