Plugin Directory

Changeset 1525870


Ignore:
Timestamp:
11/01/2016 11:00:24 AM (9 years ago)
Author:
inigoini
Message:

updating TheCartPress-FrontEnd 1.6

Location:
thecartpress-frontend/trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • thecartpress-frontend/trunk/FrontEnd.class.php

    r1261070 r1525870  
    44Plugin URI: http://wordpress.org/extend/plugins/thecartpress-frontend/
    55Description: Allows to set some admin panels in the front end
    6 Version: 1.5
     6Version: 1.6
    77Author: TheCartPress team
    88Author URI: http://thecartpress.com
     
    2828 */
    2929
     30// Exit if accessed directly
     31if ( !defined( 'ABSPATH' ) ) exit;
     32
     33if ( !class_exists( 'TCPFrontEnd' ) ) :
     34
    3035class TCPFrontEnd {
    3136
    3237    function __construct() {
    33         add_action( 'tcp_init'                                  , array( $this, 'init' ) );
    34         add_action( 'tcp_admin_init'                            , array( $this, 'admin_init' ) );
    35         add_action( 'tcp_author_profile_bottom'                 , array( $this, 'tcp_author_profile_bottom' ) );
     38
     39        add_action( 'tcp_init'                  , array( $this, 'init' ) );
     40        add_action( 'tcp_admin_init'            , array( $this, 'admin_init' ) );
     41        add_action( 'tcp_author_profile_bottom' , array( $this, 'tcp_author_profile_bottom' ) );
    3642
    3743        add_filter( 'body_class'                                , array( $this, 'body_classes' ) );
     
    201207     */
    202208    function tcp_check_the_plugin( $warnings ) {
    203         $page_id = get_option( 'tcp_my_account_page_id' );
    204         if ( ! $page_id || ! get_page( $page_id ) ) {
    205             $warnings[] = __( '<strong>My Account page</strong> has been deleted.', 'tcp-fe' );
    206         }
     209        //$page_id = get_option( 'tcp_my_account_page_id' );
     210        //if ( ! $page_id || ! get_page( $page_id ) ) {
     211        //  $warnings[] = __( '<strong>My Account page</strong> has been deleted.', 'tcp-fe' );
     212        //}
    207213
    208214        // if my addresses page exists
     
    317323
    318324    function body_classes( $classes ) {
     325
    319326        if ( $this->is_page( get_option( 'tcp_my_account_page_id' ) ) ) {
    320327            $classes[] = 'tcp-store';
    321328            $classes[] = 'tcp-my-account-page';
     329
    322330        } elseif ( $this->is_page( get_option( 'tcp_addresses_list_page_id' ) ) ) {
    323331            $classes[] = 'tcp-store';
    324332            $classes[] = 'tcp-addresses-list-page';
     333
    325334        } elseif ( $this->is_page( get_option( 'tcp_address_edit_page_id' ) ) ) {
    326335            $classes[] = 'tcp-store';
    327336            $classes[] = 'tcp-address-edit-page';
     337
    328338        } elseif ( $this->is_page( get_option( 'tcp_downloadable_list_page_id' ) ) ) {
    329339            $classes[] = 'tcp-store';
    330340            $classes[] = 'tcp-downloadable-list-page';
     341
    331342        } elseif ( $this->is_page( get_option( 'tcp_orders_list_page_id' ) ) ) {
    332343            $classes[] = 'tcp-store';
     
    357368}
    358369
     370endif;
     371
    359372new TCPFrontEnd();
    360373
    361 // Template functions added by TheCartPress front end
    362 
     374// Template functions added by TheCartPress Front end plugin
     375
     376/**
     377 * Returns My Orders page URL
     378 */
    363379function tcp_the_my_orders_url( $echo = true ) {
    364380    $url = get_permalink( tcp_get_current_id( get_option( 'tcp_orders_list_page_id' ), 'page' ) );
     
    367383}
    368384
     385/**
     386 * Returns My Addresses page URL
     387 */
    369388function tcp_the_my_addresses_url( $echo = true ) {
    370389    $url = get_permalink( tcp_get_current_id( get_option( 'tcp_addresses_list_page_id' ), 'page' ) );
     
    373392}
    374393
     394/**
     395 * Returns My Downloads page URL
     396 */
    375397function tcp_the_my_downloadables_url( $echo = true ) {
    376398    $url = get_permalink( tcp_get_current_id( get_option( 'tcp_downloadable_list_page_id' ), 'page' ) );
  • thecartpress-frontend/trunk/admin/OrdersList.class.php

    r1261070 r1525870  
    2424
    2525class TCPOrdersList {
     26
    2627    function show( $echo = true ) {
    27         global $current_user;
    28         get_currentuserinfo();
     28
     29        $current_user = wp_get_current_user();
    2930        if ( $current_user->ID == 0 ) {
    3031            ob_start(); ?>
  • thecartpress-frontend/trunk/readme.txt

    r1261071 r1525870  
    4040
    4141== Changelog ==
     42= 1.6 =
     43Italian translation. thanks to Emanuele Persiani
     44
    4245= 1.5 =
    4346* UI Improvements
Note: See TracChangeset for help on using the changeset viewer.