本文整理汇总了PHP中prepend_attachment函数的典型用法代码示例。如果您正苦于以下问题:PHP prepend_attachment函数的具体用法?PHP prepend_attachment怎么用?PHP prepend_attachment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了prepend_attachment函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sdm_get_item_description_output
function sdm_get_item_description_output($id)
{
$item_description = get_post_meta($id, 'sdm_description', true);
$isset_item_description = isset($item_description) && !empty($item_description) ? $item_description : '';
//$isset_item_description = apply_filters('the_content', $isset_item_description);
$isset_item_description = do_shortcode($isset_item_description);
$isset_item_description = wptexturize($isset_item_description);
$isset_item_description = convert_smilies($isset_item_description);
$isset_item_description = convert_chars($isset_item_description);
$isset_item_description = wpautop($isset_item_description);
$isset_item_description = shortcode_unautop($isset_item_description);
$isset_item_description = prepend_attachment($isset_item_description);
return $isset_item_description;
}
示例2: prepare_output
/**
* prepare the ads frontend output
*
* @param obj $ad ad object
* @return str $content ad content prepared for frontend output
* @since 1.0.0
*/
public function prepare_output($ad)
{
// apply functions normally running through the_content filter
// the_content filter not used here because it created an infinite loop (ads within ads)
$output = wptexturize($ad->content);
$output = convert_smilies($output);
$output = convert_chars($output);
$output = wpautop($output);
$output = shortcode_unautop($output);
$output = do_shortcode($output);
$output = prepend_attachment($output);
return $output;
}
示例3: prepare_output
/**
* prepare the ads frontend output
*
* @param obj $ad ad object
* @return str $content ad content prepared for frontend output
* @since 1.0.0
*/
public function prepare_output($ad)
{
// apply functions normally running through the_content filter
// the_content filter is not used here because it created an infinite loop (ads within ads for "before content" and other auto injections)
// maybe the danger is not here yet, but changing it to use the_content filter changes a lot
$output = $ad->content;
$output = wptexturize($output);
$output = convert_smilies($output);
$output = convert_chars($output);
$output = wpautop($output);
$output = shortcode_unautop($output);
$output = do_shortcode($output);
$output = prepend_attachment($output);
// make included images responsive, since WordPress 4.4
if (!defined('ADVADS_DISABLE_RESPONSIVE_IMAGES') && function_exists('wp_make_content_images_responsive')) {
$output = wp_make_content_images_responsive($output);
}
return $output;
}
示例4: _format_content
function _format_content($content)
{
if ('yes' == builder_get_theme_setting('widget_content_the_content_filter')) {
return apply_filters('the_content', $content);
}
$content = wptexturize($content);
$content = convert_smilies($content);
$content = convert_chars($content);
$content = wpautop($content);
$content = shortcode_unautop($content);
$content = prepend_attachment($content);
$content = do_shortcode($content);
return $content;
}
示例5: prepare_output
/**
* prepare the ads frontend output
*
* @param obj $ad ad object
* @return str $content ad content prepared for frontend output
* @since 1.0.0
*/
public function prepare_output($ad)
{
// apply functions normally running through the_content filter
// the_content filter is not used here because it created an infinite loop (ads within ads for "before content" and other auto injections)
// maybe the danger is not here yet, but changing it to use the_content filter changes a lot
$output = $ad->content;
$output = wptexturize($output);
$output = convert_smilies($output);
$output = convert_chars($output);
$output = wpautop($output);
$output = shortcode_unautop($output);
$output = do_shortcode($output);
$output = prepend_attachment($output);
return $output;
}
示例6: get_static_content
static function get_static_content($args = array())
{
$default = array('id' => false, 'post_type' => 'static_block', 'class' => '', 'title' => '', 'showtitle' => false, 'titletag' => 'h3');
$args = (object) array_merge($default, $args);
// Find the page data
if (!empty($args->id)) {
// Get content by ID or slug
$id = $args->id;
$id = !is_numeric($id) ? get_ID_by_slug($id, $args->post_type) : $id;
// Get the page contenet
$page_data = get_page($id);
} else {
$page_data = null;
}
// Format and return data
if (is_null($page_data)) {
return '<!-- [No arguments where provided or the values did not match an existing static block] -->';
} else {
// The content
$content = $page_data->post_content;
$content = apply_filters('static_content', $content);
// NOTE: This entire section could be setup as a filter.
if (get_post_meta($id, 'content_filters', true) == 'all') {
// Apply all WP content filters, including those added by plugins.
// This can still have autop turned off with our internal filter.
$GLOBALS['wpautop_post'] = $page_data;
// not default $post so global variable used by wpautop_disable(), if function exists
$content = apply_filters('the_content', $content);
} else {
// Only apply default WP filters. This is the safe way to add basic formatting without any plugin injected filters
$content = wptexturize($content);
$content = convert_smilies($content);
$content = convert_chars($content);
if (get_post_meta($id, 'wpautop', true) == 'on') {
// (!wpautop_disable($id)) {
$content = wpautop($content);
// Add paragraph tags.
}
$content = shortcode_unautop($content);
$content = prepend_attachment($content);
$content = do_shortcode($content);
}
$class = !empty($args->class) ? trim($args->class) : '';
$content = '<div id="static-content-' . $id . '" class="static-content ' . $class . '">' . $content . '</div>';
// The title
if (!empty($args->title)) {
$title = $args->title;
$showtitle = true;
} else {
$title = $page_data->post_title;
$showtitle = $args->showtitle;
}
if ($showtitle) {
$content = '<' . $args->titletag . ' class="static-content-title page-title">' . $page_data->post_title . '</' . $args->titletag . '>' . $content;
}
// Return content
return $content;
}
}
示例7: wpcf_access_do_shortcode_content
public static function wpcf_access_do_shortcode_content($content, $raw)
{
if (function_exists('WPV_wpcf_record_post_relationship_belongs')) {
$content = WPV_wpcf_record_post_relationship_belongs($content);
}
if (class_exists('WPV_template')) {
global $WPV_templates;
$content = $WPV_templates->the_content($content);
}
if (isset($GLOBALS['wp_embed'])) {
global $wp_embed;
$content = $wp_embed->run_shortcode($content);
$content = $wp_embed->autoembed($content);
}
if (function_exists('wpv_resolve_internal_shortcodes')) {
$content = wpv_resolve_internal_shortcodes($content);
}
if (function_exists('wpv_resolve_wpv_if_shortcodes')) {
$content = wpv_resolve_wpv_if_shortcodes($content);
}
$content = convert_smilies($content);
//Enable wpautop if raw = false
if ($raw == 'false') {
$content = wpautop($content);
}
$content = shortcode_unautop($content);
$content = prepend_attachment($content);
$content = do_shortcode($content);
$content = capital_P_dangit($content);
return $content;
}
示例8: yiw_clean_text
/**
* Replace the default get_the_content, managing better the shortcodes
*
* @param string $str The string to convert
* @return string The string converted
*
* @since 1.0
*/
function yiw_clean_text($str)
{
$str = yiw_addp($str);
$str = prepend_attachment($str);
return $str;
}
示例9: convert_custom_field_editor
/**
* エディターで入力された値をコンバートする
*
* @param $name カスタムフィールドの名前
*/
protected function convert_custom_field_editor($content)
{
$content = wptexturize($content);
$content = convert_smilies($content);
$content = convert_chars($content);
$content = wpautop($content);
$content = shortcode_unautop($content);
$content = prepend_attachment($content);
$content = do_shortcode($content);
return $content;
}
示例10: filter_evo_content
function filter_evo_content($str)
{
$str = wptexturize($str);
$str = convert_smilies($str);
$str = convert_chars($str);
$str = wpautop($str);
$str = shortcode_unautop($str);
$str = prepend_attachment($str);
$str = do_shortcode($str);
return $str;
}
示例11: theme_get_page
function theme_get_page($id, $title = false)
{
global $post, $tempPost;
if (!$id) {
return false;
}
// Get the page contenet
$page_data = get_page($id);
if ($page_data == null) {
$page_data = $post;
}
$content = $page_data->post_content;
// get the content
// Apply filters
if (get_meta('content_filters', $id) == 'All Content Filters') {
// This option applies all content filters, including those added by plugins. It still makes use of the filters in Theme Settings
$tempPost = $page_data;
// Used as global variable in 'the_content' filters
$content = apply_filters('the_content', $content);
// run remaining Wordpress filters such as paragraph tags.
unset($GLOBALS['tempPost']);
} else {
// Only apply default WP filters. This is the safe way to go so we don't risk any plugin injection/overrides of 'the_content'
$content = wptexturize($content);
$content = convert_smilies($content);
$content = convert_chars($content);
if (!wpautop_filter($id)) {
$content = wpautop($content);
// Add paragraph tags.
}
$content = shortcode_unautop($content);
$content = prepend_attachment($content);
$content = do_shortcode($content);
}
// Get title, add to output<br />
if ($title) {
$content = '<h3 class="content_static pageTitle">' . $page_data->post_title . '</h3>' . $content;
}
// Apply function specific
$content = apply_filters('theme_get_page', $content, $id);
return $content;
}
示例12: get_content_for_layout
function get_content_for_layout($id, $title = false)
{
global $bbpress;
if (!$id) {
return false;
}
// Get the page contenet
$page_data = get_post($id);
$content = $page_data->post_content;
// get the content
if ($page_data->post_type == 'forum') {
$forum_id = $id;
$content = empty($bbpress['context']) ? "[bbp-single-forum id={$forum_id}]" : $bbpress['context'];
}
// Apply only default filters. This is the safe way, not
// risking plugin injection/overrides of 'the_content'
$content = wptexturize($content);
$content = convert_smilies($content);
$content = convert_chars($content);
if (!wpautop_disable($id)) {
$content = wpautop($content);
// Add paragraph tags.
}
$content = shortcode_unautop($content);
$content = prepend_attachment($content);
$content = do_shortcode($content);
// Get title, add to output<br />
if ($title) {
$content = '<h3 class="layout-block-title page-title">' . $page_data->post_title . '</h3>' . $content;
}
// Apply function specific
$content = apply_filters('get_content_for_layout', $content, $id);
return $content;
}
示例13: get_content
function get_content($avoidPluginFilters = false, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '')
{
$content = get_the_content($more_link_text, $stripteaser, $more_file);
if ($avoidPluginFilters) {
$content = wptexturize($content);
$content = convert_smilies($content);
$content = convert_chars($content);
$content = wpautop($content);
$content = shortcode_unautop($content);
$content = prepend_attachment($content);
} else {
$content = apply_filters('the_content', $content);
}
$content = str_replace(']]>', ']]>', $content);
return $content;
}
示例14: ht_content_formatter
function ht_content_formatter($str)
{
$str = ht_autop($str);
$str = prepend_attachment($str);
return $str;
}
示例15: add_the_content_filter
/**
* デフォルトで the_content に適用される関数を適用
*
* @param string $value
* @return string
*/
protected function add_the_content_filter($value)
{
if (has_filter('the_content', 'wptexturize')) {
$value = wptexturize($value);
}
if (has_filter('the_content', 'convert_smilies')) {
$value = convert_smilies($value);
}
if (has_filter('the_content', 'convert_chars')) {
$value = convert_chars($value);
}
if (has_filter('the_content', 'wpautop')) {
$value = wpautop($value);
}
if (has_filter('the_content', 'shortcode_unautop')) {
$value = shortcode_unautop($value);
}
if (has_filter('the_content', 'prepend_attachment')) {
$value = prepend_attachment($value);
}
return $value;
}