コード例 #1
0
ファイル: wpseo.php プロジェクト: nanookYs/orientreizen
/**
 * Manages compatibility functions with WordPress SEO plugin
 *
 *
 * @version		1.0.0
 * @package		digital-products-order/functions
 * @author 		Norbert Dreszer
 */
function implecode_wpseo_compatible()
{
    $post_type = get_quasi_post_type();
    if ($post_type == 'al_product') {
        add_filter('wpseo_metabox_prio', 'implecode_wpseo_compatible_priority');
    }
}
コード例 #2
0
ファイル: templates-functions.php プロジェクト: RA2WP/RA2WP
/**
 * Replaces auto products listing, product category pages and product search title with appropriate entries
 *
 * @param string $page_title
 * @param int $id
 * @return string
 */
function override_product_page_title($page_title, $id = null)
{
    if (!is_admin() && is_ic_catalog_page() && !is_ic_product_page() && !in_the_loop() && !is_ic_shortcode_query() && (empty($id) || get_quasi_post_type(get_post_type($id)) == 'al_product')) {
        $archive_names = get_archive_names();
        if (is_ic_taxonomy_page()) {
            $the_tax = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
            $page_title = $archive_names['all_prefix'] . ' ' . $the_tax->name;
        } else {
            if (is_ic_product_search()) {
                $page_title = __('Search Results for:', 'ecommerce-product-catalog') . ' ' . $_GET['s'];
            } else {
                if (is_ic_product_listing()) {
                    $page_title = get_product_listing_title();
                }
            }
        }
    }
    return $page_title;
}
コード例 #3
0
ファイル: templates.php プロジェクト: satokora/IT354Project
function product_page_content($content)
{
    if ('al_product' == get_quasi_post_type() && get_integration_type() == 'simple') {
        if (is_single()) {
            ob_start();
            content_product_adder();
            $content = ob_get_contents();
            ob_end_clean();
        }
    }
    return $content;
}
コード例 #4
0
function set_product_messages($messages)
{
    global $post, $post_ID;
    $quasi_post_type = get_quasi_post_type();
    $post_type = get_post_type($post_ID);
    if ($quasi_post_type == 'al_product') {
        $obj = get_post_type_object($post_type);
        $singular = $obj->labels->singular_name;
        $messages[$post_type] = array(0 => '', 1 => sprintf(__('%s updated. <a href="%s">View ' . strtolower($singular) . '</a>'), $singular, esc_url(get_permalink($post_ID))), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => sprintf(__('%s updated.', 'al-ecommerce-product-catalog'), $singular), 5 => isset($_GET['revision']) ? sprintf(__($singular . ' restored to revision from %s'), $singular, wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__($singular . ' published. <a href="%s">View ' . strtolower($singular) . '</a>'), esc_url(get_permalink($post_ID)), $singular), 7 => __('Page saved.'), 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>'), $singular, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), strtolower($singular)), 9 => sprintf(__('%3$s scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview ' . strtolower($singular) . '</a>'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID)), $singular), 10 => sprintf(__('%s draft updated. <a target="_blank" href="%s">Preview ' . strtolower($singular) . '</a>'), $singular, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
    }
    return $messages;
}