Plugin Directory

Changeset 2986962


Ignore:
Timestamp:
10/31/2023 06:31:43 PM (2 years ago)
Author:
cylas
Message:

version 1.0.2 release

Location:
admin-previous-and-next-order-edit-links-for-woocommerce/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • admin-previous-and-next-order-edit-links-for-woocommerce/trunk/README.txt

    r2944263 r2986962  
    33Contributors:      cylas
    44Requires at least: 5.2 or higher
    5 Tested up to:      6.3
    6 Requires PHP:      7.0.0
    7 Stable tag:        1.0.1
     5Tested up to:      6.4
     6Requires PHP:      5.6
     7Stable tag:        1.0.2
    88Donate link:       https://www.buymeacoffee.com/BELOCODES
    99License:           GPLv2 or later
     
    7575Bug Fixes plus minor upgrades
    7676
     77= 1.0.2 =
     78Woocommerce HPOS integration, syncing wordpress' default button style
  • admin-previous-and-next-order-edit-links-for-woocommerce/trunk/admin/class-previous-next-edit-order-links-for-woocommerce-admin.php

    r2932985 r2986962  
    5858     * Register the stylesheets for the admin area.
    5959     *
    60      * @since    1.0.1
     60     * @since    1.0.2
    6161     */
    6262    public function enqueue_styles() {
     
    7474         */
    7575
    76         wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/previous-next-edit-order-links-for-woocommerce-admin.css', array(), $this->version, 'all' );
     76         wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/previous-next-edit-order-links-for-woocommerce-admin.css', array(), '1.0.21', 'all' );
    7777
    7878    }
     
    8181     * Register the JavaScript for the admin area.
    8282     *
    83      * @since    1.0.1
     83     * @since    1.0.2
    8484     */
    8585    public function enqueue_scripts() {
     
    100100  $screen_id = false;
    101101  $final_prev_next_output = array("prev"=>0,"next"=>0);
    102   global $post;
    103 
     102  global $post;
    104103 if ( function_exists( 'get_current_screen' ) ) {
     104   
     105     $screen    = get_current_screen();
     106     
     107     $screen_id = isset( $screen, $screen->id ) ? $screen->id : '';
     108     
    105109     
    106      $screen    = get_current_screen();
    107      $screen_id = isset( $screen, $screen->id ) ? $screen->id : '';
    108      if ( $screen_id == 'shop_order' ) {
    109        
     110     if ( $screen_id == 'woocommerce_page_wc-orders'
     111     && get_option( 'woocommerce_custom_orders_table_enabled' ) == "yes"
     112     && $_GET['action'] == 'edit'
     113     )
     114      {
    110115     global $post, $wpdb, $theorder;
     116         
     117            $order_navigation = $wpdb->get_row( $wpdb->prepare( "
     118            SELECT
     119                (SELECT ID FROM {$wpdb->prefix}wc_orders
     120                WHERE id < %d
     121                AND type = '%s'
     122                AND status <> 'trash'
     123                ORDER BY ID DESC LIMIT 1 )
     124                AS prev_order_id,
     125                (SELECT ID FROM {$wpdb->prefix}wc_orders
     126                WHERE id > %d
     127                AND type = '%s'
     128                AND status <> 'trash'
     129                ORDER BY ID ASC LIMIT 1 )
     130                AS next_order_id
     131        ", $theorder->get_id(), 'shop_order', $theorder->ID, 'shop_order' ), ARRAY_A );
     132    }
     133    else if( $screen_id == 'shop_order'
     134    && get_option( 'woocommerce_custom_orders_table_enabled' ) == "no"){
     135        global $post, $wpdb, $theorder;
    111136
    112137        if ( ! is_object( $theorder ) ) {
    113138             $theorder = wc_get_order( $post->ID );
    114         }
    115 
    116         $order_type_object = get_post_type_object( $post->post_type );
    117 
     139        }
     140         
    118141        $order_navigation = $wpdb->get_row( $wpdb->prepare( "
    119142            SELECT
     
    131154                AS next_order_id
    132155        ", $post->ID, $post->post_type, $post->ID, $post->post_type ), ARRAY_A );
     156
     157    }
     158           
     159         
     160       
     161       
     162       
    133163       
    134164    //Filling the Output array---------   
    135       if ( array_filter( $order_navigation ) ) :
    136          
    137        endif;
     165       
     166        if(!empty($order_navigation[ 'prev_order_id' ])){
     167        $final_prev_next_output["prev"] = admin_url( 'post.php?post='.$order_navigation[ 'prev_order_id' ].'&action=edit' );
     168        }
     169        if(!empty($order_navigation[ 'next_order_id' ])){
     170        $final_prev_next_output["next"] = admin_url( 'post.php?post='.$order_navigation[ 'next_order_id' ].'&action=edit' );
     171        }
     172 
     173        //Enqueuing the Output JS scripts---------
    138174
    139  
    140 if(!empty($order_navigation[ 'prev_order_id' ])){
    141 $final_prev_next_output["prev"] = admin_url( 'post.php?post='.$order_navigation[ 'prev_order_id' ].'&action=edit' );
    142 }
    143 if(!empty($order_navigation[ 'next_order_id' ])){
    144 $final_prev_next_output["next"] = admin_url( 'post.php?post='.$order_navigation[ 'next_order_id' ].'&action=edit' );
    145 }
    146  
    147 //Enqueuing the Output JS scripts---------
    148 
    149 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) .
    150 'js/previous-next-edit-order-links-for-woocommerce-admin.js', array( 'jquery' ), $this->version, false );
    151 wp_localize_script($this->plugin_name, 'prev_next_script_vars', array(
    152 "prev" => $final_prev_next_output["prev"],
    153 "prev_text" => __('Previous Order','belo_prev_next_domain'),
    154 "next" => $final_prev_next_output["next"],
    155 "next_text" => __('Next Order','belo_prev_next_domain')
    156 )
    157 );
    158 }
     175        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) .
     176        'js/previous-next-edit-order-links-for-woocommerce-admin.js', array( 'jquery' ), $this->version, false );
     177        wp_localize_script($this->plugin_name, 'prev_next_script_vars', array(
     178        "prev" => $final_prev_next_output["prev"],
     179        "prev_text" => __('Previous Order','belo_prev_next_domain'),
     180        "next" => $final_prev_next_output["next"],
     181        "next_text" => __('Next Order','belo_prev_next_domain')
     182        )
     183        );
    159184}
    160185
  • admin-previous-and-next-order-edit-links-for-woocommerce/trunk/admin/css/previous-next-edit-order-links-for-woocommerce-admin.css

    r2878036 r2986962  
    33 * included in this file.
    44 */
    5  .belo_prev_next {
    6     width: 100%;
    7     display: flex;
    8     justify-content: space-between;
    9     margin-bottom: 30px;
     5.belo_prev_next {
     6  width: 100%;
     7  display: flex;
     8  justify-content: space-between;
     9  margin-bottom: 30px;
    1010}
    1111.belo_prev_next {
    12     width: 100%;
     12  width: 100%;
    1313}
    1414
    1515.prev_buttn {
    16     float: left !important;
    17     color: #fff !important;
    18     background: linear-gradient(0deg, rgb(36 66 188) 0%, rgb(0 153 255) 100%) !important;
    19     border: none;
    20     border-radius: 5px;
    21     padding: 10px 25px;
    22     font-family: 'Lato', sans-serif;
    23     font-weight: 500;
    24     background: transparent;
    25     cursor: pointer;
    26     transition: all 0.3s ease;
    27     position: relative;
    28     display: inline-block;
    29     box-shadow: inset 2px 2px 2px 0px rgb(255 255 255 / 50%), 7px 7px 20px 0px rgb(0 0 0 / 10%), 4px 4px 5px 0px rgb(0 0 0 / 10%);
    30     outline: none;
    31 }
    32 .prev_buttn:hover, .next_buttn:hover{
    33     background: linear-gradient(175deg, rgb(36 66 188) 0%, rgb(0 153 255) 100%) !important;
     16  float: left !important;
     17  border: none;
     18  border-radius: 5px;
     19  padding: 10px 25px;
     20  font-family: "Lato", sans-serif;
     21  font-weight: 500;
     22  cursor: pointer;
     23  transition: all 0.3s ease;
     24  position: relative;
     25  display: inline-block;
     26  outline: none;
    3427}
    3528
    36 .next_buttn{
    37     float: right !important;
    38     color: #fff !important;
    39     background: linear-gradient(0deg, rgb(36 66 188) 0%, rgb(0 153 255) 100%) !important;
    40     border: none;
    41     border-radius: 5px;
    42     padding: 10px 25px;
    43     font-family: 'Lato', sans-serif;
    44     font-weight: 500;
    45     background: transparent;
    46     cursor: pointer;
    47     transition: all 0.3s ease;
    48     position: relative;
    49     display: inline-block;
    50     box-shadow: inset 2px 2px 2px 0px rgb(255 255 255 / 50%), 7px 7px 20px 0px rgb(0 0 0 / 10%), 4px 4px 5px 0px rgb(0 0 0 / 10%);
    51     outline: none;
     29.next_buttn {
     30  float: right !important;
     31  border: none;
     32  border-radius: 5px;
     33  padding: 10px 25px;
     34  font-family: "Lato", sans-serif;
     35  font-weight: 500;
     36  cursor: pointer;
     37  transition: all 0.3s ease;
     38  position: relative;
     39  display: inline-block;
     40  outline: none;
    5241}
    5342.belo_link_buttons {
    54     display: flex !important;
    55     justify-content: center !important;
    56     align-items: center !important;
    57     color: white !important;
    58     min-width: 120px !important;
     43  display: flex !important;
     44  justify-content: center !important;
     45  align-items: center !important;
     46  min-width: 120px !important;
    5947}
    6048
    6149.belo_link_buttons:focus {
    62     box-shadow: none !important;
    63     outline: none !important;
    64     text-decoration: none !important;
    65     display: flex;
    66     justify-content: center;
    67     align-items: center;
     50  box-shadow: none !important;
     51  outline: none !important;
     52  text-decoration: none !important;
     53  display: flex;
     54  justify-content: center;
     55  align-items: center;
    6856}
    6957
    7058.belo_link_buttons.next::after {
    71     font-family: Dashicons;
    72     font-weight: 400;
    73     font-size: 20px;
    74     text-align: center;
    75     content: "\f345";
    76     line-height: 28px;
     59  font-family: Dashicons;
     60  font-weight: 400;
     61  font-size: 20px;
     62  text-align: center;
     63  content: "\f345";
     64  line-height: 28px;
    7765}
    7866
    7967.belo_link_buttons.prev::before {
    80     font-family: Dashicons;
    81     font-weight: 400;
    82     font-size: 20px;
    83     text-align: center;
    84     content: "\f341";
    85     line-height: 28px;
     68  font-family: Dashicons;
     69  font-weight: 400;
     70  font-size: 20px;
     71  text-align: center;
     72  content: "\f341";
     73  line-height: 28px;
    8674}
  • admin-previous-and-next-order-edit-links-for-woocommerce/trunk/previous-next-edit-order-links-for-woocommerce.php

    r2932985 r2986962  
    8989 *
    9090 * @since    1.0.1
    91  */
     91 */ 
    9292function run_previous_next_edit_order_links_for_woocommerce() {
    9393
Note: See TracChangeset for help on using the changeset viewer.