Plugin Directory

Changeset 2717282


Ignore:
Timestamp:
05/02/2022 08:32:51 PM (4 years ago)
Author:
bhartlenn
Message:

Fixed a number of bugs like apostrophes showing up as html character entities, filter and sort buttons not wrapping well on mobile, etc. Please see changelog for all version 1.2.3 changes.

Location:
bw-portfolio
Files:
5 edited
7 copied

Legend:

Unmodified
Added
Removed
  • bw-portfolio/tags/1.2.3/assets/css/bw-portfolio-style.css

    r2715217 r2717282  
    77}
    88
    9 .bw_portfolio_header form {
     9.bw_portfolio_header form .portfolio_filter_sort_inputs {
    1010    display: flex;
     11    flex-wrap: wrap;
    1112    padding: 0 0 1rem;
    1213}
     
    3031    color: #111;
    3132}
    32 .bw_portfolio_header .portfolio_sort::before {
    33     content: "|";
    34     margin: 0 4px;
     33.bwbh_separator {
    3534    color: #444;
    36 }
    37 
     35    margin: 0 5px;
     36}
     37
     38/* where portfolio item cards get loaded for viewing */
    3839.bw_portfolio_content_area {
    3940    display: grid;
     
    101102}
    102103
    103 .bw_portfolio_item_image {
     104.bw_portfolio_item_image, .bw_portfolio_item_full_image {
    104105    width: 100%;
    105106    object-fit: contain;
     
    137138 * Styling for modal pop up of full portfolio item view
    138139 */
    139 .bw_portfolio_overlay {
    140     display: none;
    141     position: fixed;
    142     top: 0;
    143     left: 0;
    144     align-items: center;
    145     justify-content: center;
    146 }
    147 
    148140.bw_portfolio_modal {
    149141    display: none;
     
    151143    top: 0;
    152144    left: 0;
     145    margin: 0;
     146    padding: 0;
    153147    align-items: center;
    154148    justify-content: center;
     
    171165.bw_portfolio_modal_close {
    172166    position: relative;
    173     top: -15px;
    174     right: -25px;
     167    top: ;
     168    right: ;
    175169    padding: 0;
    176170    margin: 0;
     
    186180    flex-direction: column;
    187181    margin: 0 auto;
    188     padding: 2em;
     182    padding: 2%;
    189183    border-radius: 5px;
    190184    border: 1px solid #ccc;
    191185    background: #fff;
     186    color: #222;
    192187    font-size: 1em;
    193188    width: 94%;
     
    209204@media only screen and (max-width: 600px) {
    210205    .bw_portfolio_item_full {
    211         width: 98%;
     206        width: 92%;
     207        padding: 3%;
    212208    }
    213209}
     
    217213    .bw_portfolio_item_full {
    218214        width: 96%;
     215        padding: 1%;
    219216    }
    220217}
     
    230227    .bw_portfolio_item_full {
    231228        width: 92%;
     229        padding: 3%;
    232230    }
    233231}
     
    237235    .bw_portfolio_item_full {
    238236        width: 75%;
    239     }
    240 }
     237        padding: 2em;
     238    }
     239}
  • bw-portfolio/tags/1.2.3/assets/js/bw-portfolio-script.js

    r2715217 r2717282  
    207207                    .then( response => response.json() )
    208208                    .then( data => {
    209                        
    210                         console.log(data);
    211                        
     209                                               
    212210                        bwbh_loader_gif.remove();
    213211                                           
     
    232230                            const bwbh_portfolio_heading = document.createElement('h3');
    233231                            bwbh_portfolio_heading.setAttribute('class', 'bw_portfolio_item_title');
    234                             bwbh_portfolio_heading.innerHTML = data.portfolio_items[bwbh_key].title;
     232                            bwbh_portfolio_heading.textContent = data.portfolio_items[bwbh_key].title;
    235233                            bwbh_portfolio_text.appendChild(bwbh_portfolio_heading);
    236234                           
  • bw-portfolio/tags/1.2.3/bw-portfolio.php

    r2715217 r2717282  
    33* Plugin Name: BW Portfolio
    44* Description: The BW Portfolio plugin is powerful yet lightweight and fast. It allows you to easily add portfolio items in your WordPress Dashboard, and organize them with portfolio tags as well. Then by using a handy shortcode you can display your portfolio items just about anywhere in a nice, responsive css grid that is compatible on many different devices. Also has tag filtering and sorting of portfolio items built in.
    5 * Version: 1.2.2
     5* Version: 1.2.3
    66* Requires at least: 5.2
    77* Requires PHP: 7.0
     
    8181            // store the needed post data to send back in rest response
    8282            $bw_response_data = [
    83                 'title' => esc_html__($bw_post->post_title),
     83                'title' => html_entity_decode($bw_post->post_title),
    8484                'content' => apply_filters('the_content', $bw_post->post_content ),
    8585            ];
     
    149149                $bw_response_data['portfolio_items'][$n] = [
    150150                    'bw_portfolio_id' => get_the_ID(),
    151                     'title' => get_the_title(),
     151                    'title' => html_entity_decode(get_the_title()),
    152152                    'content' => wp_kses_post( bwbh_limit_words( strip_tags( get_the_content() ), $bwbh_num_of_words ) ) . '...',
    153153                ];
  • bw-portfolio/tags/1.2.3/inc/portfolio-loop.php

    r2715217 r2717282  
    88    $bw_portfolio_id = uniqid();
    99   
    10     $portfolio_output .= "<section id='bw_portfolio_" . $bw_portfolio_id . "' class='bw_portfolio_container alignwide'>\n";
     10    $portfolio_output .= "<section id='bw_portfolio_" . $bw_portfolio_id . "' class='bw_portfolio_container alignwide'>";
    1111
    12     $portfolio_output .= "<header class='bw_portfolio_header'>\n";
     12    $portfolio_output .= "<header class='bw_portfolio_header'>";
    1313   
    1414    if( !empty($bw_atts['portfolio_title']) ) {
    15         $portfolio_output .= "<h2 class='bw_portfolio_heading'>" .  esc_html__( $bw_atts['portfolio_title'] ) . "</h2>\n";
     15        $portfolio_output .= "<h2 class='bw_portfolio_heading'>" .  esc_html__( $bw_atts['portfolio_title'] ) . "</h2>";
    1616    }
    1717    /**
     
    2525    $portfolio_output .= "<form id='portfolio_filter_sort_form_" . $bw_portfolio_id . "'>";
    2626
     27    $portfolio_output .= "<section class='portfolio_filter_sort_inputs'>";
     28
    2729    if( !is_wp_error($bw_portfolio_tags) && count($bw_portfolio_tags) > 0 ) {
    2830       
    29         $portfolio_output .= "<section class='portfolio_filter_tags'>\n";
     31       
    3032               
    3133        $portfolio_output .= "<input id='pt_show_all_" . $bw_portfolio_id . "' type='radio' name='bwbh_portfolio_filter_tag' value='show_all' checked><label class='bw_portfolio_form_label' for='pt_show_all_" . $bw_portfolio_id . "' title='Show all portfolio items'>Show All</label>";
     
    4244           
    4345        }
    44        
    45         $portfolio_output .= "</section>";
     46         $portfolio_output .= " <span class='bwbh_separator'>|</span> ";
     47        //$portfolio_output .= "</section>";
    4648    }
    4749
    4850    // sort buttons
    49     $portfolio_output .= "<section class='portfolio_sort'>";
     51    //$portfolio_output .= "<section class='portfolio_sort'>";
    5052
     53   
    5154    $portfolio_output .= "<input id='ps_desc_" . $bw_portfolio_id . "' type='radio' name='bwbh_portfolio_sort' value='DESC' checked><label class='bw_portfolio_form_label' for='ps_desc_" . $bw_portfolio_id . "' title='Show newest first'>Newest</label>";
    5255    $portfolio_output .= "<input id='ps_asc_" . $bw_portfolio_id . "' type='radio' name='bwbh_portfolio_sort' value='ASC'><label class='bw_portfolio_form_label' for='ps_asc_" . $bw_portfolio_id . "' title='Show oldest first'>Oldest</label>";
     
    5659    $portfolio_output .= "</form>";
    5760       
    58     $portfolio_output .= "</header>\n";
     61    $portfolio_output .= "</header>";
    5962   
    6063    // if user sets columns attribute, add a custom css class to the css grid container that overrides grid-template-columns value
     
    101104    $data_num_of_words = "data-num_of_words='" . $num_of_words . "'";
    102105   
    103     $portfolio_output .= "<div class='bw_portfolio_content_area" . $bw_content_classes . "' " . $data_num_of_words . ">\n";
     106    $portfolio_output .= "<div class='bw_portfolio_content_area" . $bw_content_classes . "' " . $data_num_of_words . ">";
    104107
    105108    while ( $bw_portfolio_query->have_posts() ) : $bw_portfolio_query->the_post();
    106109        // add portfolio item html to output variable
    107         $portfolio_output .= "<article class='bw_portfolio_item' data-post_id='" . get_the_ID() . "' data-permalink='" . get_the_permalink() . "' >\n";
     110        $portfolio_output .= "<article class='bw_portfolio_item' data-post_id='" . get_the_ID() . "' data-permalink='" . get_the_permalink() . "' >";
    108111       
    109112        // if user adds modal_off attribute, then add html anchor link to handle normal anchor link click to the full portfolio item being displayed by theme template
     
    114117        $portfolio_output .= "<img src='" . esc_url( get_the_post_thumbnail_url(get_the_ID(), 'large') ) . "' class='bw_portfolio_item_image'>";
    115118       
    116         $portfolio_output .= "<div class='bw_portfolio_item_text'>\n";
     119        $portfolio_output .= "<div class='bw_portfolio_item_text'>";
    117120   
    118         $portfolio_output .= "<h3 class='bw_portfolio_item_title'>" . esc_html( get_the_title() ) . "</h3>\n";
     121        $portfolio_output .= "<h3 class='bw_portfolio_item_title'>" . esc_html( get_the_title() ) . "</h3>";
    119122               
    120         $portfolio_output .= "<section class='bw_portfolio_item_content'>\n" . wp_kses_post( bwbh_limit_words( strip_tags(get_the_content()), $num_of_words ) ) . "...\n</section>\n";
     123        $portfolio_output .= "<section class='bw_portfolio_item_content'>" . wp_kses_post( bwbh_limit_words( strip_tags(get_the_content()), $num_of_words ) ) . "...</section>";
    121124       
    122125        // check if shortcode attribute show_tags is present
     
    149152        }
    150153           
    151         $portfolio_output .= "</article>\n";
     154        $portfolio_output .= "</article>";
    152155       
    153156    endwhile;
    154157
    155     $portfolio_output .= "</div>\n";
     158    $portfolio_output .= "</div>";
    156159
    157     $portfolio_output .= "</section>\n";
     160    $portfolio_output .= "</section>";
    158161
    159162else :
  • bw-portfolio/tags/1.2.3/readme.txt

    r2715217 r2717282  
    44Tags: portfolio, shortcode, grid, modal
    55Requires at least: 5.2
    6 Tested up to: 5.9
     6Tested up to: 5.9.3
    77Requires PHP: 7.0
    8 Stable tag: 1.2.2
     8Stable tag: 1.2.3
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3434
    3535== Changelog ==
     36
     37= 1.2.3 =
     38* Fixed full portfolio item display being spuished on mobile
     39* Fixed color of portfolio text in twentytwentytwo theme and blocks
     40* Fixed filter and sort tags layout
     41* Fixed portfolio items with apostrophe's in title showing &#039; instead of an apostrophe
     42* Removed and erroneous console.log that was used for testing and logged portfolio item attributes
    3643
    3744= 1.2.2 =
  • bw-portfolio/trunk/assets/css/bw-portfolio-style.css

    r2715217 r2717282  
    77}
    88
    9 .bw_portfolio_header form {
     9.bw_portfolio_header form .portfolio_filter_sort_inputs {
    1010    display: flex;
     11    flex-wrap: wrap;
    1112    padding: 0 0 1rem;
    1213}
     
    3031    color: #111;
    3132}
    32 .bw_portfolio_header .portfolio_sort::before {
    33     content: "|";
    34     margin: 0 4px;
     33.bwbh_separator {
    3534    color: #444;
    36 }
    37 
     35    margin: 0 5px;
     36}
     37
     38/* where portfolio item cards get loaded for viewing */
    3839.bw_portfolio_content_area {
    3940    display: grid;
     
    101102}
    102103
    103 .bw_portfolio_item_image {
     104.bw_portfolio_item_image, .bw_portfolio_item_full_image {
    104105    width: 100%;
    105106    object-fit: contain;
     
    137138 * Styling for modal pop up of full portfolio item view
    138139 */
    139 .bw_portfolio_overlay {
    140     display: none;
    141     position: fixed;
    142     top: 0;
    143     left: 0;
    144     align-items: center;
    145     justify-content: center;
    146 }
    147 
    148140.bw_portfolio_modal {
    149141    display: none;
     
    151143    top: 0;
    152144    left: 0;
     145    margin: 0;
     146    padding: 0;
    153147    align-items: center;
    154148    justify-content: center;
     
    171165.bw_portfolio_modal_close {
    172166    position: relative;
    173     top: -15px;
    174     right: -25px;
     167    top: ;
     168    right: ;
    175169    padding: 0;
    176170    margin: 0;
     
    186180    flex-direction: column;
    187181    margin: 0 auto;
    188     padding: 2em;
     182    padding: 2%;
    189183    border-radius: 5px;
    190184    border: 1px solid #ccc;
    191185    background: #fff;
     186    color: #222;
    192187    font-size: 1em;
    193188    width: 94%;
     
    209204@media only screen and (max-width: 600px) {
    210205    .bw_portfolio_item_full {
    211         width: 98%;
     206        width: 92%;
     207        padding: 3%;
    212208    }
    213209}
     
    217213    .bw_portfolio_item_full {
    218214        width: 96%;
     215        padding: 1%;
    219216    }
    220217}
     
    230227    .bw_portfolio_item_full {
    231228        width: 92%;
     229        padding: 3%;
    232230    }
    233231}
     
    237235    .bw_portfolio_item_full {
    238236        width: 75%;
    239     }
    240 }
     237        padding: 2em;
     238    }
     239}
  • bw-portfolio/trunk/assets/js/bw-portfolio-script.js

    r2715217 r2717282  
    207207                    .then( response => response.json() )
    208208                    .then( data => {
    209                        
    210                         console.log(data);
    211                        
     209                                               
    212210                        bwbh_loader_gif.remove();
    213211                                           
     
    232230                            const bwbh_portfolio_heading = document.createElement('h3');
    233231                            bwbh_portfolio_heading.setAttribute('class', 'bw_portfolio_item_title');
    234                             bwbh_portfolio_heading.innerHTML = data.portfolio_items[bwbh_key].title;
     232                            bwbh_portfolio_heading.textContent = data.portfolio_items[bwbh_key].title;
    235233                            bwbh_portfolio_text.appendChild(bwbh_portfolio_heading);
    236234                           
  • bw-portfolio/trunk/bw-portfolio.php

    r2715217 r2717282  
    33* Plugin Name: BW Portfolio
    44* Description: The BW Portfolio plugin is powerful yet lightweight and fast. It allows you to easily add portfolio items in your WordPress Dashboard, and organize them with portfolio tags as well. Then by using a handy shortcode you can display your portfolio items just about anywhere in a nice, responsive css grid that is compatible on many different devices. Also has tag filtering and sorting of portfolio items built in.
    5 * Version: 1.2.2
     5* Version: 1.2.3
    66* Requires at least: 5.2
    77* Requires PHP: 7.0
     
    8181            // store the needed post data to send back in rest response
    8282            $bw_response_data = [
    83                 'title' => esc_html__($bw_post->post_title),
     83                'title' => html_entity_decode($bw_post->post_title),
    8484                'content' => apply_filters('the_content', $bw_post->post_content ),
    8585            ];
     
    149149                $bw_response_data['portfolio_items'][$n] = [
    150150                    'bw_portfolio_id' => get_the_ID(),
    151                     'title' => get_the_title(),
     151                    'title' => html_entity_decode(get_the_title()),
    152152                    'content' => wp_kses_post( bwbh_limit_words( strip_tags( get_the_content() ), $bwbh_num_of_words ) ) . '...',
    153153                ];
  • bw-portfolio/trunk/inc/portfolio-loop.php

    r2715217 r2717282  
    88    $bw_portfolio_id = uniqid();
    99   
    10     $portfolio_output .= "<section id='bw_portfolio_" . $bw_portfolio_id . "' class='bw_portfolio_container alignwide'>\n";
     10    $portfolio_output .= "<section id='bw_portfolio_" . $bw_portfolio_id . "' class='bw_portfolio_container alignwide'>";
    1111
    12     $portfolio_output .= "<header class='bw_portfolio_header'>\n";
     12    $portfolio_output .= "<header class='bw_portfolio_header'>";
    1313   
    1414    if( !empty($bw_atts['portfolio_title']) ) {
    15         $portfolio_output .= "<h2 class='bw_portfolio_heading'>" .  esc_html__( $bw_atts['portfolio_title'] ) . "</h2>\n";
     15        $portfolio_output .= "<h2 class='bw_portfolio_heading'>" .  esc_html__( $bw_atts['portfolio_title'] ) . "</h2>";
    1616    }
    1717    /**
     
    2525    $portfolio_output .= "<form id='portfolio_filter_sort_form_" . $bw_portfolio_id . "'>";
    2626
     27    $portfolio_output .= "<section class='portfolio_filter_sort_inputs'>";
     28
    2729    if( !is_wp_error($bw_portfolio_tags) && count($bw_portfolio_tags) > 0 ) {
    2830       
    29         $portfolio_output .= "<section class='portfolio_filter_tags'>\n";
     31       
    3032               
    3133        $portfolio_output .= "<input id='pt_show_all_" . $bw_portfolio_id . "' type='radio' name='bwbh_portfolio_filter_tag' value='show_all' checked><label class='bw_portfolio_form_label' for='pt_show_all_" . $bw_portfolio_id . "' title='Show all portfolio items'>Show All</label>";
     
    4244           
    4345        }
    44        
    45         $portfolio_output .= "</section>";
     46         $portfolio_output .= " <span class='bwbh_separator'>|</span> ";
     47        //$portfolio_output .= "</section>";
    4648    }
    4749
    4850    // sort buttons
    49     $portfolio_output .= "<section class='portfolio_sort'>";
     51    //$portfolio_output .= "<section class='portfolio_sort'>";
    5052
     53   
    5154    $portfolio_output .= "<input id='ps_desc_" . $bw_portfolio_id . "' type='radio' name='bwbh_portfolio_sort' value='DESC' checked><label class='bw_portfolio_form_label' for='ps_desc_" . $bw_portfolio_id . "' title='Show newest first'>Newest</label>";
    5255    $portfolio_output .= "<input id='ps_asc_" . $bw_portfolio_id . "' type='radio' name='bwbh_portfolio_sort' value='ASC'><label class='bw_portfolio_form_label' for='ps_asc_" . $bw_portfolio_id . "' title='Show oldest first'>Oldest</label>";
     
    5659    $portfolio_output .= "</form>";
    5760       
    58     $portfolio_output .= "</header>\n";
     61    $portfolio_output .= "</header>";
    5962   
    6063    // if user sets columns attribute, add a custom css class to the css grid container that overrides grid-template-columns value
     
    101104    $data_num_of_words = "data-num_of_words='" . $num_of_words . "'";
    102105   
    103     $portfolio_output .= "<div class='bw_portfolio_content_area" . $bw_content_classes . "' " . $data_num_of_words . ">\n";
     106    $portfolio_output .= "<div class='bw_portfolio_content_area" . $bw_content_classes . "' " . $data_num_of_words . ">";
    104107
    105108    while ( $bw_portfolio_query->have_posts() ) : $bw_portfolio_query->the_post();
    106109        // add portfolio item html to output variable
    107         $portfolio_output .= "<article class='bw_portfolio_item' data-post_id='" . get_the_ID() . "' data-permalink='" . get_the_permalink() . "' >\n";
     110        $portfolio_output .= "<article class='bw_portfolio_item' data-post_id='" . get_the_ID() . "' data-permalink='" . get_the_permalink() . "' >";
    108111       
    109112        // if user adds modal_off attribute, then add html anchor link to handle normal anchor link click to the full portfolio item being displayed by theme template
     
    114117        $portfolio_output .= "<img src='" . esc_url( get_the_post_thumbnail_url(get_the_ID(), 'large') ) . "' class='bw_portfolio_item_image'>";
    115118       
    116         $portfolio_output .= "<div class='bw_portfolio_item_text'>\n";
     119        $portfolio_output .= "<div class='bw_portfolio_item_text'>";
    117120   
    118         $portfolio_output .= "<h3 class='bw_portfolio_item_title'>" . esc_html( get_the_title() ) . "</h3>\n";
     121        $portfolio_output .= "<h3 class='bw_portfolio_item_title'>" . esc_html( get_the_title() ) . "</h3>";
    119122               
    120         $portfolio_output .= "<section class='bw_portfolio_item_content'>\n" . wp_kses_post( bwbh_limit_words( strip_tags(get_the_content()), $num_of_words ) ) . "...\n</section>\n";
     123        $portfolio_output .= "<section class='bw_portfolio_item_content'>" . wp_kses_post( bwbh_limit_words( strip_tags(get_the_content()), $num_of_words ) ) . "...</section>";
    121124       
    122125        // check if shortcode attribute show_tags is present
     
    149152        }
    150153           
    151         $portfolio_output .= "</article>\n";
     154        $portfolio_output .= "</article>";
    152155       
    153156    endwhile;
    154157
    155     $portfolio_output .= "</div>\n";
     158    $portfolio_output .= "</div>";
    156159
    157     $portfolio_output .= "</section>\n";
     160    $portfolio_output .= "</section>";
    158161
    159162else :
  • bw-portfolio/trunk/readme.txt

    r2715217 r2717282  
    44Tags: portfolio, shortcode, grid, modal
    55Requires at least: 5.2
    6 Tested up to: 5.9
     6Tested up to: 5.9.3
    77Requires PHP: 7.0
    8 Stable tag: 1.2.2
     8Stable tag: 1.2.3
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3434
    3535== Changelog ==
     36
     37= 1.2.3 =
     38* Fixed full portfolio item display being spuished on mobile
     39* Fixed color of portfolio text in twentytwentytwo theme and blocks
     40* Fixed filter and sort tags layout
     41* Fixed portfolio items with apostrophe's in title showing &#039; instead of an apostrophe
     42* Removed and erroneous console.log that was used for testing and logged portfolio item attributes
    3643
    3744= 1.2.2 =
Note: See TracChangeset for help on using the changeset viewer.