這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Post Moon

外掛說明

This plugin lets you debugging your AJAX actions to your WordPress site.

螢幕擷圖

  • The view of the results after AJAX request.

安裝方式

  1. Download the plugin.
  2. Activate the plugin in the WordPress Admin Panel.
  3. Usage of the plugin:
    Shortcode: “[moon selector=”my_products” category=”laptops” method=”post” action=”postmoon” post_type=”product” ppp=”5″ order=”DESC”]
    or in php place do_shortcode(‘[moon selector=”my_products” category=”laptops” method=”post” action=”postmoon” post_type=”product” ppp=”5″ order=”DESC”]’)”.

    The “selector” is ID of the your DOM element.

    function.php very basic example of the code:

“function postmoon_action_method(){
if(isset($_POST[“post_type”])){
$args = array(
‘posts_per_page’ => sanitize_text_field($_POST[“ppp”]),
‘post_type’ => sanitize_text_field($_POST[“post_type”]),
‘product_cat’ => sanitize_text_field($_POST[“category”]),
‘order’ => sanitize_text_field($_POST[“order”])
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) {
echo ‘

    ‘;
    while ( $query->have_posts() ) : $query->the_post();
    global $product;
    $product_output = ‘

  • ‘;
    $product_output .= ”.$product->get_title().”;
    $image_links[0] = get_post_thumbnail_id( $product->id );
    $gallery = wp_get_attachment_image_src($image_links[0], ‘full’ );
    $product_output .= “”;
    $product_output .= ”.$product->get_price_html().”;
    $product_output .= ‘
  • ‘;
    echo $product_output;
    endwhile;
    echo ‘

‘;
wp_reset_postdata();
}
}
die();
}”.
“add_action(“wp_ajax_postmoon”,”postmoon_action_method”);”.

“add_action(“wp_ajax_nopriv_postmoon”,”postmoon_action_method”);”.

The results you will see in the your browser only if you are administrator.

常見問題集

There are currently no FAQs at this time.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Post Moon〉的開發相關工作。

參與者

將〈Post Moon〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.0

  • First version of the plugin.