Skip to content

Commit

Permalink
Release new version 2.8.0
Browse files Browse the repository at this point in the history
= 2.8.0 - 2019/09/07 =
* This feature upgrade adds a3Portfolio Gutenberg Block plus 5 filter blocks. Also includes inclusion of shortcodes into core for those still using the legacy editor.
* Feature - a3 Portfolio Premium shortcodes plugin discontinued, shortcodes now included in the parent plugin.
* Feature - Add a3 Portfolio Gutenberg block.
* Feature - Add Portfolio Items Gutenberg block
* Feature - Add Portfolio Categories Gutenberg block
* Feature - Add Portfolio Tags Gutenberg block
* Feature - Add Portfolio Recent Gutenberg block
* Feature - Add Portfolio Sticky Gutenberg block
* Tweak - Remove a3 Portfolio Shortcode placecard and link from admin dashboard sidebar
  • Loading branch information
alextuan committed Sep 7, 2019
1 parent 924512f commit 5829ee8
Show file tree
Hide file tree
Showing 62 changed files with 5,786 additions and 17 deletions.
6 changes: 3 additions & 3 deletions a3-portfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
/*
Plugin Name: a3 Portfolio
Description: Creates a beautiful fully mobile responsive, fully customizable, Google images style portfolio to showcase your work.
Version: 2.7.5
Version: 2.8.0
Author: a3rev Software
Author URI: https://a3rev.com/
Requires at least: 4.6
Tested up to: 5.2.2
Tested up to: 5.2.3
Text Domain: a3-portfolio
Domain Path: /languages
License: GPLv2 or later
Expand All @@ -33,7 +33,7 @@
define('A3_PORTFOLIO_TEMPLATE_IMAGES_URL', A3_PORTFOLIO_URL . '/templates/images');

define( 'A3_PORTFOLIO_KEY', 'a3_portfolios' );
define( 'A3_PORTFOLIO_VERSION', '2.7.5' );
define( 'A3_PORTFOLIO_VERSION', '2.8.0' );
define( 'A3_PORTFOLIO_G_FONTS', true );

/**
Expand Down
129 changes: 129 additions & 0 deletions admin/admin-pages/admin-shortcodes-page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?php
/* "Copyright 2012 a3 Revolution Web Design" This software is distributed under the terms of GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 */
// File Security Check
if ( ! defined( 'ABSPATH' ) ) exit;
?>
<?php
/*-----------------------------------------------------------------------------------
Portfolio Shortcodes Settings Page
TABLE OF CONTENTS
- var menu_slug
- var page_data
- __construct()
- page_init()
- page_data()
- add_admin_menu()
- tabs_include()
- admin_settings_page()
-----------------------------------------------------------------------------------*/

class A3_Portfolio_Shortcodes_Page extends A3_Portfolio_Admin_UI
{
/**
* @var string
*/
private $menu_slug = 'a3-portfolio-shortcodes';

/**
* @var array
*/
private $page_data;

/*-----------------------------------------------------------------------------------*/
/* __construct() */
/* Settings Constructor */
/*-----------------------------------------------------------------------------------*/
public function __construct() {
$this->page_init();
$this->tabs_include();
}

/*-----------------------------------------------------------------------------------*/
/* page_init() */
/* Page Init */
/*-----------------------------------------------------------------------------------*/
public function page_init() {

add_filter( $this->plugin_name . '_add_admin_menu', array( $this, 'add_admin_menu' ) );
}

/*-----------------------------------------------------------------------------------*/
/* page_data() */
/* Get Page Data */
/*-----------------------------------------------------------------------------------*/
public function page_data() {



$page_data = array(
'type' => 'submenu',
'parent_slug' => 'edit.php?post_type=a3-portfolio',
'page_title' => __('Shortcodes','a3_portfolio_shortcodes'),
'menu_title' => __('Shortcodes','a3_portfolio_shortcodes'),
'capability' => 'manage_options',
'menu_slug' => $this->menu_slug,
'function' => 'a3_portfolio_shortcodes_page_show',
'admin_url' => 'edit.php?post_type=a3-portfolio',
'callback_function' => '',
'script_function' => '',
'view_doc' => '',
);

if ( $this->page_data ) return $this->page_data;
return $this->page_data = $page_data;

}

/*-----------------------------------------------------------------------------------*/
/* add_admin_menu() */
/* Add This page to menu on left sidebar */
/*-----------------------------------------------------------------------------------*/
public function add_admin_menu( $admin_menu ) {

if ( ! is_array( $admin_menu ) ) $admin_menu = array();
$admin_menu[] = $this->page_data();

return $admin_menu;
}

/*-----------------------------------------------------------------------------------*/
/* tabs_include() */
/* Include all tabs into this page
/*-----------------------------------------------------------------------------------*/
public function tabs_include() {
include_once( A3_PORTFOLIO_FILE_PATH . '/admin' . '/tabs/template-settings/shortcode-tab.php' );
}

/*-----------------------------------------------------------------------------------*/
/* admin_settings_page() */
/* Show Settings Page */
/*-----------------------------------------------------------------------------------*/
public function admin_settings_page() {
//global $a3_portfolio_admin_init;

//$a3_portfolio_admin_init->admin_settings_page( $this->page_data() );

global $a3_portfolio_shortcodes_panel;

$a3_portfolio_shortcodes_panel->settings_form();
}

}

global $a3_portfolio_shortcodes_page;
$a3_portfolio_shortcodes_page = new A3_Portfolio_Shortcodes_Page();

/**
* a3_portfolio_shortcodes_page_show()
* Define the callback function to show page content
*/
function a3_portfolio_shortcodes_page_show() {
global $a3_portfolio_shortcodes_page;
$a3_portfolio_shortcodes_page->admin_settings_page();
}

?>
22 changes: 22 additions & 0 deletions admin/plugin-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ public function includes_framework() {
do_action( 'a3_portfolios_before_include_admin_page' );

include( 'admin-pages/admin-settings-page.php' );
include( 'admin-pages/admin-shortcodes-page.php' );

// Remove hook from shortcode addon
global $a3_portfolio_shortcodes_addon;
if ( $a3_portfolio_shortcodes_addon ) {
remove_action( 'a3_portfolios_after_include_admin_page', array( $a3_portfolio_shortcodes_addon, 'includes_admin_page' ) );
}

do_action( 'a3_portfolios_after_include_admin_page' );

Expand All @@ -51,6 +58,7 @@ public function includes() {
include( A3_PORTFOLIO_DIR . '/includes/frontend/a3-portfolio-template-functions.php' );
include( A3_PORTFOLIO_DIR . '/includes/frontend/class-a3-portfolio-template-loader.php' );
include( A3_PORTFOLIO_DIR . '/includes/a3-portfolio-core-functions.php' );
include( A3_PORTFOLIO_DIR . '/includes/a3-portfolio-shortcode-functions.php' );

if ( is_admin() ) {
include( A3_PORTFOLIO_DIR . '/includes/backend/class-a3-portfolio-backend-scripts.php' );
Expand All @@ -61,6 +69,13 @@ public function includes() {
include( A3_PORTFOLIO_DIR . '/includes/post-types/a3-portfolio-duplicate.php' );
}

if ( is_admin() ) {
$current_url = add_query_arg();
if ( ! defined( 'A3_PORTFOLIO_SHORTCODES_KEY' ) && ( false !== stristr( $current_url, 'post.php' ) || false !== stristr( $current_url, 'edit-tags.php' ) ) ) {
include( A3_PORTFOLIO_DIR . '/includes/backend/class-a3-portfolio-shortcodes-hooks.php' );
}
}

include( A3_PORTFOLIO_DIR . '/includes/widgets/class-portfolio-recently-viewed-widget.php' );
include( A3_PORTFOLIO_DIR . '/includes/widgets/class-portfolio-categories-widget.php' );
include( A3_PORTFOLIO_DIR . '/includes/widgets/class-portfolio-tags-widget.php' );
Expand All @@ -71,9 +86,16 @@ public function includes() {
include( A3_PORTFOLIO_DIR . '/includes/frontend/a3-portfolio-template-hooks.php' );
include( A3_PORTFOLIO_DIR . '/includes/a3-portfolio-shortcodes.php' );

if ( ! is_admin() && ! defined( 'A3_PORTFOLIO_SHORTCODES_KEY' ) ) {
include( A3_PORTFOLIO_DIR . '/includes/shortcodes/class-shortcodes-display.php' );
}

// Include Permalinks Structure
include( A3_PORTFOLIO_DIR . '/includes/backend/class-a3-portfolio-permalinks-structure.php' );

// Gutenberg Blocks
include( A3_PORTFOLIO_DIR . '/src/blocks.php' );

do_action( 'a3_portfolios_after_include_files' );
}

Expand Down
Loading

0 comments on commit 5829ee8

Please sign in to comment.