Skip to content

Commit de2f49a

Browse files
authored
Merge pull request #21 from justcoded/release
Refactoring of namespaces and class names according to WP standards, new version 2.0
2 parents f5ed3f6 + c38e991 commit de2f49a

29 files changed

+189
-163
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "justcoded/just-theme-framework",
3-
"description": "Lightweight MVC theming framework for developers who want to better organize their own custom themes with an MVC approach.",
2+
"name": "justcoded/wordpress-theme-framework",
3+
"description": "Lightweight theme framework base with Model-View concept for developers who want to better organize their own custom themes.",
44
"keywords": ["plugin","wordpress","theme framework","mvc"],
5-
"type": "wordpress-plugin",
5+
"type": "wordpress-muplugin",
66
"authors": [
77
{
88
"name": "Alex Prokopenko",
@@ -13,10 +13,10 @@
1313
],
1414
"support": {
1515
"email": "aprokopenko@justcoded.com",
16-
"issues": "https://github.com/justcoded/just-theme-framework/issues"
16+
"issues": "https://github.com/justcoded/wordpress-theme-framework/issues"
1717
},
1818
"require": {
19-
"php": ">=5.5",
19+
"php": ">=7.0",
2020
"johnpbloch/wordpress": ">=4.7",
2121
"composer/installers": "~1.0"
2222
},
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
2-
namespace JustCoded\ThemeFramework\Admin;
2+
namespace JustCoded\WP\Framework\Admin;
33

44
/**
55
* Theme Settings base class
66
* Contain few methods to work with Titan framework
77
*/
8-
abstract class ThemeSettings {
8+
abstract class Theme_Settings {
99
/**
1010
* Unique framework instance to be used
1111
*
@@ -45,7 +45,7 @@ public static function get( $option_name ) {
4545

4646
/**
4747
* Run tabs methods one by one
48-
* Search for function self::register{ucfirst(slug)}Tab
48+
* Search for function self::register_{slug}_tab
4949
*
5050
* @param \TitanFrameworkAdminPage $panel Titan framework panel object.
5151
* @param array $tabs Tabs init callbacks to be executed.
@@ -54,9 +54,9 @@ public static function get( $option_name ) {
5454
*/
5555
public function add_panel_tabs( $panel, $tabs ) {
5656
foreach ( $tabs as $slug => $name ) {
57-
$method = 'register' . ucfirst( $slug ) . 'Tab';
57+
$method = 'register_' . $slug . '_tab';
5858
if ( ! method_exists( $this, $method ) ) {
59-
throw new \Exception( 'ThemeSettings: Unable to find tab method "' . $method . '"' );
59+
throw new \Exception( 'Theme_Settings: Unable to find tab method "' . $method . '"' );
6060
}
6161

6262
$this->$method( $panel );

framework/Autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace JustCoded\ThemeFramework;
2+
namespace JustCoded\WP\Framework;
33

44
/**
55
* SPL autoload registration for theme to prevent using file includes

framework/Objects/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace JustCoded\ThemeFramework\Objects;
2+
namespace JustCoded\WP\Framework\Objects;
33

44
/**
55
* Model is the base class for data models.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<?php
2-
namespace JustCoded\ThemeFramework\Objects;
2+
namespace JustCoded\WP\Framework\Objects;
33

4-
use JustCoded\ThemeFramework\Web\View;
5-
use JustCoded\ThemeFramework\Web\ViewsRule;
4+
use JustCoded\WP\Framework\Web\View;
5+
use JustCoded\WP\Framework\Web\Views_Rule;
66

77
/**
88
* Custom post type class to simplify the process of registering post type.
99
* Options are rewritten to be more simple for understanding.
1010
* However they affect all standard options from here:
1111
* https://codex.wordpress.org/Function_Reference/register_post_type
1212
*/
13-
abstract class PostType {
13+
abstract class Post_Type {
1414
/**
15-
* PostType ID. Used to store it in DB and identify by post_type key
15+
* Post_Type ID. Used to store it in DB and identify by post_type key
1616
* SHOULD BE OVERWRITTEN IN CHILD CLASS
1717
*
1818
* @var string
1919
*/
2020
public static $ID;
2121

2222
/**
23-
* PostType rewrite prefix, called slug. Will be present in URL structure
23+
* Post_Type rewrite prefix, called slug. Will be present in URL structure
2424
* SHOULD BE OVERWRITTEN IN CHILD CLASS
2525
*
2626
* @var string

framework/Objects/Taxonomy.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
2-
namespace JustCoded\ThemeFramework\Objects;
2+
namespace JustCoded\WP\Framework\Objects;
33

4-
use JustCoded\ThemeFramework\Web\ViewsRule;
5-
use JustCoded\ThemeFramework\Web\View;
4+
use JustCoded\WP\Framework\Web\Views_Rule;
5+
use JustCoded\WP\Framework\Web\View;
66

77
/**
88
* Custom Taxonomy class to simplify the process of registering Taxonomy.

framework/PageBuilder/v25/Layouts/Layout.php renamed to framework/Page_Builder/v25/Layouts/Layout.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace JustCoded\ThemeFramework\PageBuilder\v25\Layouts;
3+
namespace JustCoded\WP\Framework\Page_Builder\v25\Layouts;
44

55
/**
66
* Class Layout
77
* Starting from Page Builder v2.5 all inline css were moved into separate inline css block.
8-
* Since we remove all inline css from PageBuilder - we need to enable back this feature.
8+
* Since we remove all inline css from Page_Builder - we need to enable back this feature.
99
*
1010
* For image attachment we can use rwd plugin for better support.
1111
*/

framework/PageBuilder/v25/Layouts/RowLayout.php renamed to framework/Page_Builder/v25/Layouts/Row_Layout.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
2-
namespace JustCoded\ThemeFramework\PageBuilder\v25\Layouts;
2+
namespace JustCoded\WP\Framework\Page_Builder\v25\Layouts;
33

44
/**
5-
* Class RowLayout
5+
* Class Row_Layout
66
*
7-
* @package JustCoded\ThemeFramework\SOPanels
7+
* @package JustCoded\WP\Framework\SOPanels
88
*/
9-
class RowLayout extends Layout {
9+
class Row_Layout extends Layout {
1010
/**
1111
* Row Layout identifier
1212
* should be overwritten in child class
@@ -45,7 +45,7 @@ class RowLayout extends Layout {
4545
public $cell_index;
4646

4747
/**
48-
* RowLayout constructor.
48+
* Row_Layout constructor.
4949
*
5050
* @throws \Exception Missing $ID or $TITLE properties.
5151
*/

framework/PageBuilder/v25/Layouts/RwdRowLayout.php renamed to framework/Page_Builder/v25/Layouts/Rwd_Row_Layout.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
2-
namespace JustCoded\ThemeFramework\PageBuilder\v25\Layouts;
2+
namespace JustCoded\WP\Framework\Page_Builder\v25\Layouts;
33

44
/**
55
* Class Grid12RowLayout
66
*
7-
* @package JustCoded\ThemeFramework\SOPanels
7+
* @package JustCoded\WP\Framework\SOPanels
88
*/
9-
class RwdRowLayout extends RowLayout {
9+
class Rwd_Row_Layout extends Row_Layout {
1010
/**
1111
* ID
1212
*

framework/PageBuilder/v25/Layouts/RwdWidgetLayout.php renamed to framework/Page_Builder/v25/Layouts/Rwd_Widget_Layout.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
2-
namespace JustCoded\ThemeFramework\PageBuilder\v25\Layouts;
2+
namespace JustCoded\WP\Framework\Page_Builder\v25\Layouts;
33

44
/**
5-
* Class WidgetLayout
5+
* Class Widget_Layout
66
*
7-
* @package JustCoded\ThemeFramework\SOPanels
7+
* @package JustCoded\WP\Framework\SOPanels
88
*/
9-
class RwdWidgetLayout extends WidgetLayout {
9+
class Rwd_Widget_Layout extends Widget_Layout {
1010
/**
1111
* Widget Layout identifier
1212
* should be overwritten in child class

0 commit comments

Comments
 (0)