Skip to content

Commit 40c8914

Browse files
committed
first commit
0 parents  commit 40c8914

File tree

256 files changed

+41452
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+41452
-0
lines changed

gpl.txt

+674
Large diffs are not rendered by default.

readme.txt

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
=== TypeRocket UI - WordPress Post Types Plus ===
2+
Contributors: kevindees
3+
Tags: custom post types, CPT, CMS, post, types, post type, taxonomy, tax, custom, content types, post types, box, meta-box, meta-boxes
4+
Requires at least: 5.5
5+
Requires PHP: 7.2.5
6+
Tested up to: 5.5.1
7+
Stable Tag: 5.0.0
8+
License: GPLv2 or later
9+
10+
This plugin provides a powerful user interface for creating post types, taxonomies, and meta boxes.
11+
12+
== Description ==
13+
14+
This plugin provides a powerful user interface for creating post types, taxonomies, and meta boxes. TypeRocket UI goes beyond the typical registration tools with advanced features like:
15+
16+
1. Setting post type placeholder text.
17+
2. Set the number of post type revisions.
18+
3. Add custom field columns to your post types table view.
19+
4. And much more.
20+
21+
== Installation ==
22+
23+
Upload the typerocket-ui plugin to your blog. Activate it! Then Go to TypeRocket UI in the main admin menu and start registering your post types.
24+
25+
== Screenshots ==
26+
27+
1. Registration UI.
28+
29+
== Changelog ==
30+
31+
= 5.0 =
32+
33+
* Custom Post Type, Taxonomies, and Meta Box UI

screenshot-1.png

154 KB
Loading

typerocket-ui.php

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
/*
3+
Plugin Name: TypeRocket UI
4+
Plugin URI: https://typerocket.com/ui/
5+
Description: This plugin provides a powerful user interface for creating post types, taxonomies, and meta boxes.
6+
Version: 5.0.0
7+
Requires PHP: 7.2
8+
Tags: videos, fitvids, responsive
9+
Author: TypeRocket
10+
Author URI: https://typerocket.com
11+
License: GPLv3 or later
12+
*/
13+
defined( 'ABSPATH' ) or die( 'Nothing here to see!' );
14+
15+
class TypeRocketUIPlugin
16+
{
17+
public $path = null;
18+
public $message = '';
19+
public $activating = false;
20+
public $id = 'typerocket_ui_register';
21+
22+
public function __construct()
23+
{
24+
if(defined('TR_PLUGIN_INSTALL') || defined('TR_PATH')) {
25+
add_filter('plugin_action_links',function ($actions, $plugin_file) {
26+
if( $found = strpos(__FILE__, $plugin_file) ) {
27+
$actions['settings'] = '<span style="color: red">Inactive Install</span>';
28+
}
29+
30+
return $actions;
31+
}, 10, 2 );
32+
33+
return;
34+
}
35+
36+
$this->loadConfig();
37+
require 'typerocket/init.php';
38+
39+
$this->path = plugin_dir_path(__FILE__);
40+
define('TR_AUTO_LOADER', '__return_false');
41+
add_filter('plugin_action_links', [$this, 'links'], 10, 2 );
42+
}
43+
44+
public function links($actions, $plugin_file) {
45+
if( $found = strpos(__FILE__, $plugin_file) ) {
46+
$url = menu_page_url($this->id, false);
47+
$actions['settings'] = '<a href="'.$url.'" aria-label="TypeRocket UI">Settings</a>';
48+
}
49+
50+
return $actions;
51+
}
52+
53+
public function loadConfig()
54+
{
55+
define('TR_PLUGIN_INSTALL', __DIR__);
56+
define('TR_CORE_CONFIG_PATH', __DIR__ . '/typerocket/config' );
57+
define('TR_APP_NAMESPACE', 'TR_UI');
58+
define('TR_ROOT_WP', ABSPATH);
59+
60+
define('TR_AUTOLOAD_APP', [
61+
'prefix' => TR_APP_NAMESPACE . '\\',
62+
'folder' => __DIR__ . '/typerocket/app/',
63+
]);
64+
}
65+
}
66+
67+
new TypeRocketUIPlugin();

typerocket/.gitignore

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Your Files
2+
3+
# Vendor
4+
node_modules
5+
package-lock.json
6+
vendor/*
7+
!vendor/composer
8+
!vendor/typerocket
9+
vendor/typerocket/core/assets
10+
vendor/typerocket/core/templates
11+
12+
# Environment
13+
.env
14+
/wp-config.php
15+
/sql/run/*
16+
.phpunit.result.cache
17+
npm-debug.log
18+
yarn-error.log
19+
/galaxy-config.php
20+
21+
# WordPress
22+
/wordpress/*.*
23+
/wordpress/.maintenance
24+
/wordpress/wp-admin
25+
/wordpress/wp-includes
26+
/wordpress/wp-content/*
27+
!/wordpress/wp-content/mu-plugins/
28+
29+
# Source Maps
30+
*.css.map
31+
*.js.map
32+
33+
# OS
34+
*~
35+
.DS_Store*
36+
ehthumbs.db
37+
Thumbs.db
38+
39+
# IDE
40+
.idea
41+
.settings
42+
.project
43+
.build
44+
.vscode
45+
46+
# File Types
47+
*.log
48+
*.zip
49+
.svn

typerocket/app/Auth/CommentPolicy.php

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
namespace TR_UI\Auth;
3+
4+
use \TypeRocket\Auth\Policy;
5+
use TypeRocket\Models\AuthUser;
6+
use TypeRocket\Models\WPComment;
7+
8+
class CommentPolicy extends Policy
9+
{
10+
public function update(AuthUser $auth, WPComment $comment)
11+
{
12+
if( $auth->isCapable('edit_posts') || $comment->getUserID() == $auth->getID()) {
13+
return true;
14+
}
15+
16+
return false;
17+
}
18+
19+
public function create(AuthUser $auth)
20+
{
21+
if( $auth->isCapable('edit_posts') ) {
22+
return true;
23+
}
24+
25+
return false;
26+
}
27+
28+
public function destroy(AuthUser $auth, WPComment $comment)
29+
{
30+
if( $auth->isCapable('edit_posts') || $comment->getUserID() == $auth->getID()) {
31+
return true;
32+
}
33+
34+
return false;
35+
}
36+
}

typerocket/app/Auth/OptionPolicy.php

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
namespace TR_UI\Auth;
3+
4+
use \TypeRocket\Auth\Policy;
5+
use TypeRocket\Models\AuthUser;
6+
7+
class OptionPolicy extends Policy
8+
{
9+
10+
public function update(AuthUser $auth)
11+
{
12+
if( $auth->isCapable('manage_options') ) {
13+
return true;
14+
}
15+
16+
return false;
17+
}
18+
19+
public function create(AuthUser $auth)
20+
{
21+
if( $auth->isCapable('manage_options') ) {
22+
return true;
23+
}
24+
25+
return false;
26+
}
27+
28+
public function destroy(AuthUser $auth)
29+
{
30+
if( $auth->isCapable('manage_options') ) {
31+
return true;
32+
}
33+
34+
return false;
35+
}
36+
37+
38+
}

typerocket/app/Auth/PagePolicy.php

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
namespace TR_UI\Auth;
3+
4+
use App\Models\Page;
5+
use TypeRocket\Auth\Policy;
6+
use TypeRocket\Models\AuthUser;
7+
8+
class PagePolicy extends Policy
9+
{
10+
11+
public function update(AuthUser $auth, Page $page)
12+
{
13+
if( $auth->isCapable('edit_pages') || $auth->getID() == $page->getUserID()) {
14+
return true;
15+
}
16+
17+
return false;
18+
}
19+
20+
public function create(AuthUser $auth )
21+
{
22+
if( $auth->isCapable('edit_pages') ) {
23+
return true;
24+
}
25+
26+
return false;
27+
}
28+
29+
public function destroy(AuthUser $auth, Page $page)
30+
{
31+
if( $auth->isCapable('delete_pages') || $page->getUserID() == $auth->getID()) {
32+
return true;
33+
}
34+
35+
return false;
36+
}
37+
38+
}

typerocket/app/Auth/PostPolicy.php

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
namespace TR_UI\Auth;
3+
4+
use TypeRocket\Auth\Policy;
5+
use TypeRocket\Models\AuthUser;
6+
use TypeRocket\Models\WPPost;
7+
8+
class PostPolicy extends Policy
9+
{
10+
11+
public function update(AuthUser $auth, WPPost $post)
12+
{
13+
if( $auth->isCapable('edit_posts') || $auth->getID() == $post->getUserID()) {
14+
return true;
15+
}
16+
17+
return false;
18+
}
19+
20+
public function create(AuthUser $auth )
21+
{
22+
if( $auth->isCapable('edit_posts') ) {
23+
return true;
24+
}
25+
26+
return false;
27+
}
28+
29+
public function destroy(AuthUser $auth, WPPost $post)
30+
{
31+
if( $auth->isCapable('edit_posts') || $post->getUserID() == $auth->getID()) {
32+
return true;
33+
}
34+
35+
return false;
36+
}
37+
38+
}

typerocket/app/Auth/TermPolicy.php

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
namespace TR_UI\Auth;
3+
4+
use \TypeRocket\Auth\Policy;
5+
use TypeRocket\Models\AuthUser;
6+
7+
class TermPolicy extends Policy
8+
{
9+
public function update(AuthUser $auth)
10+
{
11+
if( $auth->isCapable('manage_categories') ) {
12+
return true;
13+
}
14+
15+
return false;
16+
}
17+
18+
public function create(AuthUser $auth)
19+
{
20+
if( $auth->isCapable('manage_categories') ) {
21+
return true;
22+
}
23+
24+
return false;
25+
}
26+
27+
public function destroy(AuthUser $auth)
28+
{
29+
if( $auth->isCapable('manage_categories') ) {
30+
return true;
31+
}
32+
33+
return false;
34+
}
35+
}

typerocket/app/Auth/UserPolicy.php

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
namespace TR_UI\Auth;
3+
4+
use \TypeRocket\Auth\Policy;
5+
use TypeRocket\Models\AuthUser;
6+
use TypeRocket\Models\WPUser;
7+
8+
class UserPolicy extends Policy
9+
{
10+
public function update(AuthUser $auth, WPUser $user)
11+
{
12+
if( $auth->isCapable('edit_users') || $user->getID() != $auth->getID()) {
13+
return true;
14+
}
15+
16+
return false;
17+
}
18+
19+
public function create(AuthUser $auth)
20+
{
21+
if( $auth->isCapable('create_users') ) {
22+
return true;
23+
}
24+
25+
return false;
26+
}
27+
28+
public function destroy(AuthUser $auth, WPUser $user)
29+
{
30+
if( $auth->isCapable('delete_users') || $user->getID() != $auth->getID()) {
31+
return true;
32+
}
33+
34+
return false;
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
namespace TR_UI\Controllers;
3+
4+
use TR_UI\Models\Category;
5+
use TypeRocket\Controllers\WPTermController;
6+
7+
class CategoryController extends WPTermController
8+
{
9+
protected $modelClass = Category::class;
10+
}

0 commit comments

Comments
 (0)