Plugin Directory

Changeset 3304643


Ignore:
Timestamp:
06/02/2025 06:03:00 AM (10 months ago)
Author:
vaksin
Message:

0.2.5

  • Add radas-breadcrumbs shortcode
  • Fix options page deletion
Location:
radas/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • radas/trunk/admin/option-page.php

    r3304101 r3304643  
    441441    }
    442442
    443     public function delete(){
    444         $deleted = false;
    445        
    446         if( $this->page && get_option($this->page['slug']) && !delete_option($this->page['slug'])){
    447             $deleted = true;
    448         }
    449        
    450         if ($deleted && $this->is_wpml_active){
     443    public function delete(){       
     444        if( $this->page && get_option($this->page['slug']) ){
     445            delete_option($this->page['slug']);
     446        }
     447       
     448        if ($this->is_wpml_active){
    451449            $package = $this->get_wpml_package_kind();
    452450            do_action( 'wpml_delete_package', $package['name'], $package['kind'] );
    453451        }
    454452
    455         return $deleted;
     453        return true;
    456454    }
    457455}
  • radas/trunk/admin/rest/cpt/rest-option-page.php

    r3304101 r3304643  
    265265
    266266        // refresh instance
    267         Option::delete_instance_by_id($id);
    268         Option::get_instance_by_id($id);
     267        Option::refresh_instance_by_id($id);
    269268
    270269        return Util::rest_response(
  • radas/trunk/inc/functions.php

    r3304101 r3304643  
    11<?php
    22
     3use Radas\Lib\Helper\Breadcrumb;
    34use Radas\Lib\Helper\Option;
    45
     
    1415    }
    1516}
     17
     18add_shortcode( 'radas-breadcrumbs', function($atts){
     19    $atts = shortcode_atts( array(
     20        'home_text' => null,
     21        'separator' => null,
     22    ), $atts, 'radas-breadcrumbs' );
     23
     24    return Breadcrumb::get_breadcrumb( Breadcrumb::get_radas_breadcrumb_list( $atts['home_text'] ), $atts['separator'] );
     25});
  • radas/trunk/lib/helper/breadcrumb.php

    r3304101 r3304643  
    99 */
    1010class Breadcrumb {   
    11     public static function get_breadcrumb(array $breadcrumbs, $home_text = null, $separator = null, $breadcrumb_list_div=true){       
     11    public static function get_breadcrumb(array $breadcrumbs, $separator = null){       
    1212        $separator = $separator ?? "&#187;";
    1313        $separator = ' <span class="separator">' . esc_html($separator) . '</span> ';
     
    1616        $last = array_key_last($breadcrumbs);
    1717       
    18         $output ='';
    19 
    20         if($breadcrumb_list_div){
    21             $output .= '<div itemscope itemtype="http://schema.org/BreadcrumbList" class="breadcrumbs bde-breadcrumbs" aria-label="breadcrumb">';
    22         }       
    23 
    24         $output .= "<span>";
    25        
     18        $output = '<div itemscope itemtype="http://schema.org/BreadcrumbList" class="rds-breadcrumbs" aria-label="breadcrumb"><span>';
    2619        foreach($breadcrumbs as $i => $breadcrumb){
    2720            $output .= '<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">';
     
    5144
    5245        }
    53         $output .= '</span>';
    54 
    55         if($breadcrumb_list_div){
    56             $output .= '</div>';
    57         }       
     46        $output .= '</span></div>';
    5847
    5948        return $output;
  • radas/trunk/lib/helper/option.php

    r3304101 r3304643  
    5757        $page = json_decode( get_post_meta( $post_id, 'op_json', true ), true );       
    5858        return self::delete_instance($page);
    59 
    6059    }   
    6160
     
    6867        return Instance::get_with_param(Option_Page::class, $slug, []);
    6968    }
     69
     70    public static function refresh_instance_by_id($post_id){
     71        self::delete_instance_by_id($post_id);
     72        self::get_instance_by_id($post_id);
     73    }       
    7074}
  • radas/trunk/radas.php

    r3304150 r3304643  
    44 * Plugin URI:        https://wpradas.com
    55 * Description:       The Lightweight WordPress Plugin for Effortless Options Page Creation
    6  * Version:           0.2.4
     6 * Version:           0.2.5
    77 * Requires at least: 6.5
    88 * Requires PHP:      8.0
  • radas/trunk/readme.txt

    r3304150 r3304643  
    55Requires at least: 6.5
    66Tested up to: 6.8.1
    7 Stable tag: 0.2.4
     7Stable tag: 0.2.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4242* On-the-Go Management: Manage your options pages from anywhere, providing you with the flexibility and convenience to update your site on the move.
    4343
     44
    4445== Installation ==
    4546
     
    7071
    7172== Changelog ==
     73= 0.2.5 =
     74
     75* Add radas-breadcrumbs shortcode
     76* Fix options page deletion
     77
    7278= 0.2.4 =
    7379
Note: See TracChangeset for help on using the changeset viewer.