Plugin Directory

Changeset 3182625


Ignore:
Timestamp:
11/05/2024 07:52:22 PM (17 months ago)
Author:
aponwpdev
Message:

trunk file update verison 1.0.1

Location:
pt-filter/trunk
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • pt-filter/trunk/assets/css/pfilter-template.css

    r3180324 r3182625  
    11img{
    2     width: 350px;
     2    width: 100%;
    33    height: 350px;
     4    object-fit: cover;
    45}
    56.portfolio-item {
    6     padding: 20px;
    7    
     7    padding: 15px 0;
    88}
     9/* #ajax-filter-container.grid{
     10    height: 100vh !important;
     11} */
  • pt-filter/trunk/assets/js/pfilter-ajax-load.js

    r3180324 r3182625  
    44        //// *=====* Ajax Filtering Code Here *======* ////
    55            var container = $('#ajax-filter-container');
    6             var categoryContainer = $('#ajax-category-container');
     6            // var categoryContainer = $('#ajax-category-container');
    77
    88
     
    2626                    nonce: pt_nonce2,
    2727                };
     28               
    2829                $.ajax({
    2930                    type: 'POST',
  • pt-filter/trunk/functions/pfilter-functions.php

    r3180324 r3182625  
    4545
    4646    $query = new WP_Query($args);
    47     echo '<div class="container">';
    48     echo '<div class="row">';
    4947    while ($query->have_posts()) : $query->the_post();
    5048?>
    51 <div class="col-lg-4 grid-item">
     49<div class="col-lg-4 col-md-6 col-sm-6 col-12 grid-item">
    5250    <div class="portfolio-item content-overlay">
    5351        <?php if (has_post_thumbnail()) : ?>
     
    6563    wp_reset_postdata();
    6664    die();
    67     echo "</div>";
    68     echo "</div>";
    6965}
    7066add_action('wp_ajax_ajax_filter', 'ptfilter_ajax_filter_function');
  • pt-filter/trunk/ptfilter.php

    r3180324 r3182625  
    22/**
    33 * Plugin Name: PT Filter
    4  * Plugin URI: https://wordpress.org/plugins/ptfilter
     4 * Plugin URI: devhiv.com/ptfilter
    55 * Description: This is custom post ajax filter
    6  * Version:     1.0.0
    7  * Author:      Abdul Aziz Sardar
     6 * Version:     1.0.1
     7 * Author:      aponwpdev
    88 * Author URI:  https://profiles.wordpress.org/aponwpdev/
    99 * Text Domain: pt-filter
     
    1111 * License URI:http://www.gnu.org/licenses/gpl-2.0.txt
    1212 * Requires at least: 6.2
    13  * Tested up to: 6.6
     13 * Tested up to: 6.6.2
    1414 * Requires PHP: 7.4
    1515 * Domain Path: /languages
     
    2323define('PTFILTER_PLUGIN_TEMPLATES_DIR', plugin_dir_path(__FILE__) . 'templates/');
    2424define('PTFILTER_DIR_URL_PRO', plugin_dir_url(__FILE__));
    25 define('PTFILTER_VERSION', '1.0.0');
    26 
     25define('PTFILTER_VERSION', '1.0.1');
    2726
    2827require PTFILTER_DIR_PATH_PRO . 'post-type/post-type.php';
     
    5251
    5352function ptfilter_load_text_domain() {
    54 
    5553    load_plugin_textdomain('pt-filter', false, plugin_basename(dirname(__FILE__)) . '/languages'); 
    56    
    5754}
    5855
     
    104101add_action('save_post', 'ptfilter_save_selected_template');
    105102
     103// Function to load the AJAX Load Template
     104if ( ! function_exists( 'ptfilter_ajax_load_shortcode' ) ) {
     105    function ptfilter_ajax_load_shortcode() {
     106        ob_start();
     107        $template_path = plugin_dir_path( __FILE__ ) . 'shortcode-templates/ajax-load-template.php';
     108        // Check if the template file exists before including it
     109        if ( file_exists( $template_path ) ) {
     110            include $template_path;
     111        }
     112        return ob_get_clean();
     113    }
     114}
     115// Function to load the AJAX Load More button Template
     116if( ! function_exists( 'ptfilter_ajax_load_more_shortcode' )){
     117    function ptfilter_ajax_load_more_shortcode(){
     118        ob_start();
     119        $template_path = plugin_dir_path(__FILE__) . 'shortcode-templates/ajax-loadmore-template.php';
     120         // Check if the template file exists before including it
     121         if ( file_exists( $template_path ) ) {
     122            include $template_path;
     123        }
     124        return ob_get_clean();
     125    }
     126}
    106127
    107 function ptfilter_apply_custom_page_template($template)
    108 {
     128// Function to load the isotop filter template
     129if( ! function_exists( 'ptfilter_isotop_filter_shortcode' )){
     130    function ptfilter_isotop_filter_shortcode(){
     131        ob_start();
     132        $template_path = plugin_dir_path(__FILE__) . 'shortcode-templates/isotop-load-template.php';
     133         // Check if the template file exists before including it
     134         if ( file_exists( $template_path ) ) {
     135            include $template_path;
     136        }
     137        return ob_get_clean();
     138    }
     139}
    109140
    110     $selected_template = get_post_meta(get_the_ID(), '_wp_page_template', true);
    111 
    112     if ($selected_template === 'pfilter-template.php') {
    113         // Load your custom template file when the "Pfilter Template" template is selected.
    114         $template = PTFILTER_PLUGIN_TEMPLATES_DIR . 'pfilter-template.php';
    115     } elseif ($selected_template === 'pfilter-ajax-load.php') {
    116         $template = PTFILTER_PLUGIN_TEMPLATES_DIR . 'pfilter-ajax-load.php';
    117     } elseif ($selected_template === 'pfilter-loadmore.php') {
    118         $template = PTFILTER_PLUGIN_TEMPLATES_DIR . 'pfilter-loadmore.php';
    119     } elseif($selected_template === 'pfilter-template-pagination.php') {
    120         $template = PTFILTER_PLUGIN_TEMPLATES_DIR . 'pfilter-template-pagination.php';
     141// Function to pagination template
     142if( ! function_exists( 'ptfilter_pagination_shortcode' )){
     143    function ptfilter_pagination_shortcode(){
     144        ob_start();
     145        $template_path = plugin_dir_path(__FILE__) . 'shortcode-templates/pagination-template.php';
     146         // Check if the template file exists before including it
     147         if ( file_exists( $template_path ) ) {
     148            include $template_path;
     149        }
     150        return ob_get_clean();
    121151    }
     152}
    122153
    123154
    124     return $template;
     155// Register the shortcode
     156function ptfilter_register_shortcodes() {
     157    add_shortcode('ptfilter_pagination', 'ptfilter_pagination_shortcode');
     158    add_shortcode('ptfilter_ajax_load_more_button', 'ptfilter_ajax_load_more_shortcode');
     159    add_shortcode('ptfilter_load_iso_filter', 'ptfilter_isotop_filter_shortcode');
     160    add_shortcode('ptfilter_ajax_load', 'ptfilter_ajax_load_shortcode');
    125161}
    126 add_filter('template_include', 'ptfilter_apply_custom_page_template');
     162add_action('init', 'ptfilter_register_shortcodes');
  • pt-filter/trunk/readme.txt

    r3180324 r3182625  
    77Contributors: aponwpdev
    88Requires at least: 6.1
    9 Tested up to: 6.6
    10 Stable tag: 1.0.0
     9Tested up to: 6.6.2
     10Stable tag: 1.0.1
    1111Requires PHP: 7.3
    12 Version: 1.0.0
     12Version: 1.0.1
    1313
    1414
    15 PT Filter is a custom post ajax page template.
     15PT Filter is a custom posts filtering ajax ,isotop, loadmore button, and paginations
    1616
    1717== Description ==
     
    3838    3. Then create posts and create category
    3939    4. The categories that are created should be sorted by posts
    40     5. Select any theme and create a page and select template, like there are 4 template 'Filter Template','Pagination Template','Ajax Load','Load More' then select anyone and view the page. 'NOTE:' if its FSE theme or 2024/23 wordpress default FSE theme Then create only page and come to pages dashboard then click quick edit and then select any one of the 4 templates .
     40    5. Select any theme and create a page and use the shortcode anywhere u want like ELementor/Gutenberg/wordpress default posts/pages/ wp bakery/oxyzen/divi.
     41    6.Here the 4 shortcode [ptfilter_ajax_load],[ptfilter_load_iso_filter],
     42    [ptfilter_ajax_load_more_button],
     43    [ptfilter_pagination]
     44
     45## Screenshots ##
     46
     471. After active plugin known file
     482. Create Custom Posts
     493. Create posts wise category
     504. Use 4 short code in page or any where
     515. Ajax Load view
     526. Load aso posts view
     537. Ajax button posts view
     548. Pagination view
     55
     56## Changelog ##
     57
     58= 1.0.1 06-11-2024 =
     59
     60* Compatible with your version of WordPress
     61* Bug Fixes
     62* Update code
     63* Updated documantation
     64* remove complex user compablity
Note: See TracChangeset for help on using the changeset viewer.