本文整理汇总了PHP中Bootstrap::getPluginUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::getPluginUrl方法的具体用法?PHP Bootstrap::getPluginUrl怎么用?PHP Bootstrap::getPluginUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::getPluginUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dwci_participant_callback
/**
*
*/
function dwci_participant_callback($attrs, $content)
{
$attrs = shortcode_atts(array('id' => strtoupper(substr(md5('participant-' . time() . uniqid()), 0, 10)), 'photo' => Bootstrap::getPluginUrl() . '/assets/img/no-thumb.png', 'fullname' => 'lorem ipsum dolor sit', 'category' => "0"), $attrs);
$attrs['photo'] = $attrs['photo'] == "" ? Bootstrap::getPluginUrl() . '/assets/img/no-thumb.png' : $attrs['photo'];
$path = Bootstrap::getPluginPath();
$viewPath = $path . 'templates/participants/participant.php';
ob_start();
require $viewPath;
$output = ob_get_contents();
ob_end_clean();
return $output;
}
示例2: register_callback
/**
* Allow registration to a given event id
*/
function register_callback($atts)
{
wp_enqueue_style('dwci_form_css', Bootstrap::getPluginUrl() . '/assets/css/admin-events-form.css');
wp_enqueue_script('dwci_form_js', Bootstrap::getPluginUrl() . '/assets/js/admin-events-form.js', array('jquery', 'jquery-ui-datepicker'), '20151228', true);
wp_enqueue_script('dwci_form_validator_js', '//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.2.8/jquery.form-validator.min.js', array('jquery'), '20151230', true);
$atts = shortcode_atts(array('id' => 'no foo', 'title' => 'Default title'), $atts, 'bartag');
//Check post by id.
$myquery = new WP_Query("post_type=event&meta_key=event_id&meta_value={$atts['id']}&order=ASC");
//var_dump($myquery);
if (!$myquery->posts[0]) {
return '<p class="dwci-error-msg">Undefined event for this contact form.</p>';
}
$post = $myquery->posts[0];
$path = Bootstrap::getPluginPath();
$viewPath = $path . 'templates/form.php';
ob_start();
require $viewPath;
$output = ob_get_contents();
ob_end_clean();
return $output;
}