replyToAddStyle()
replyToAddStyle()
Provides methods to enqueue or insert head tag elements into the head tag for the main framework class.
enqueueStyle(string $strSRC, string $strPageSlug, string $strTabSlug, array $arrCustomArgs) : string
Enqueues a style by page slug and tab slug.
string | $strSRC | The URL of the stylesheet to enqueue, the absolute file path, or the relative path to the root directory of WordPress. Example: '/css/mystyle.css'. |
string | $strPageSlug | (optional) The page slug that the stylesheet should be added to. If not set, it applies to all the pages created by the framework. |
string | $strTabSlug | (optional) The tab slug that the stylesheet should be added to. If not set, it applies to all the in-page tabs in the page. |
array | $arrCustomArgs | (optional) The argument array for more advanced parameters. |
The script handle ID. If the passed url is not a valid url string, an empty string will be returned.
enqueueScript(string $strSRC, string $strPageSlug, string $strTabSlug, array $arrCustomArgs) : string
Enqueues a script by page slug and tab slug.
false
.$this->enqueueScript(
plugins_url( 'asset/js/test.js' , FILE ), // source url or path
'apf_read_me', // page slug
'', // tab slug
array(
'strHandleID' => 'my_script', // this handle ID also is used as the object name for the translation array below.
'arrTranslation' => array(
'a' => 'hello world!',
'style_handle_id' => $strStyleHandle, // check the enqueued style handle ID here.
),
)
);
string | $strSRC | The URL of the stylesheet to enqueue, the absolute file path, or the relative path to the root directory of WordPress. Example: '/js/myscript.js'. |
string | $strPageSlug | (optional) The page slug that the script should be added to. If not set, it applies to all the pages created by the framework. |
string | $strTabSlug | (optional) The tab slug that the script should be added to. If not set, it applies to all the in-page tabs in the page. |
array | $arrCustomArgs | (optional) The argument array for more advanced parameters. |
The script handle ID. If the passed url is not a valid url string, an empty string will be returned.