Skip to content

Commit

Permalink
Merge pull request #43 from joanrodas/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
joanrodas authored Nov 6, 2022
2 parents 98a5cfd + d187e16 commit e016f99
Show file tree
Hide file tree
Showing 57 changed files with 8,481 additions and 3,302 deletions.
19 changes: 13 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
# editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.php]
indent_size = 4

[*.blade.php]
indent_size = 4

[resources/views/**.php]
indent_size = 4

[index.php]
indent_size = 4
48 changes: 0 additions & 48 deletions .eslintrc.js

This file was deleted.

2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.gitattributes export-ignore
/.github export-ignore
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ yarn-error.log
/vendor
resources/assets/config-local.json
.budfiles
resources/cache
resources/cache
64 changes: 32 additions & 32 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
module.exports = {
'extends': 'stylelint-config-standard',
'rules': {
'no-empty-source': null,
'string-quotes': 'double',
'at-rule-no-unknown': [
true,
{
'ignoreAtRules': [
'extend',
'at-root',
'debug',
'warn',
'error',
'if',
'else',
'for',
'each',
'while',
'mixin',
'include',
'content',
'return',
'function',
'tailwind',
'apply',
'responsive',
'variants',
'screen',
],
},
],
},
'extends': 'stylelint-config-standard',
'rules': {
'no-empty-source': null,
'string-quotes': 'double',
'at-rule-no-unknown': [
true,
{
'ignoreAtRules': [
'extend',
'at-root',
'debug',
'warn',
'error',
'if',
'else',
'for',
'each',
'while',
'mixin',
'include',
'content',
'return',
'function',
'tailwind',
'apply',
'responsive',
'variants',
'screen',
],
},
],
},
};
34 changes: 19 additions & 15 deletions Admin/AdminMenus.php
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
<?php

namespace PluginPlaceholder\Admin;

use PluginPlaceholder\Includes\BladeLoader;

class AdminMenus {
class AdminMenus
{

protected $plugin_name;
protected $plugin_version;

private $blade;

public function __construct( $plugin_name, $plugin_version ) {
public function __construct($plugin_name, $plugin_version)
{
$this->plugin_name = $plugin_name;
$this->plugin_version = $plugin_version;
$this->blade = BladeLoader::getInstance();

add_action( 'admin_menu', array($this, 'add_admin_menus') );
add_action('admin_menu', array($this, 'add_admin_menus'));
}

public function add_admin_menus() {
public function add_admin_menus()
{

// EXAMPLE
// add_menu_page(
// __( 'Custom Page Routes', 'custom-page-routes' ),
// __( 'Custom Page Routes', 'custom-page-routes' ),
// 'manage_options',
// 'custom-page-routes',
// function() {
// __( 'Custom Page Routes', 'custom-page-routes' ),
// __( 'Custom Page Routes', 'custom-page-routes' ),
// 'manage_options',
// 'custom-page-routes',
// function() {
// $this->display_template('settings');
// },
// 'dashicons-admin-settings',
// 6
// );
// 'dashicons-admin-settings',
// 6
// );

}

private function display_template(string $template) {
echo $this->blade->template($template);
private function display_template(string $template)
{
// echo $this->blade->template($template);
}

}
27 changes: 17 additions & 10 deletions Admin/AjaxActions.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
<?php

namespace PluginPlaceholder\Admin;

class AjaxActions {
class AjaxActions
{

protected $plugin_name;
protected $plugin_version;

public function __construct( $plugin_name, $plugin_version ) {
public function __construct($plugin_name, $plugin_version)
{
$this->plugin_name = $plugin_name;
$this->plugin_version = $plugin_version;
$this->add_ajax_actions();
}

private function add_ajax_non_logged_in_action($action, $function) {
add_action( "wp_ajax_nopriv_{$action}", array($this, $function) );
private function add_ajax_non_logged_in_action($action, $function)
{
add_action("wp_ajax_nopriv_{$action}", array($this, $function));
}

private function add_ajax_logged_in_action($action, $function) {
add_action( "wp_ajax_{$action}", array($this, $function) );
private function add_ajax_logged_in_action($action, $function)
{
add_action("wp_ajax_{$action}", array($this, $function));
}

private function add_ajax_general_action($action, $function) {
private function add_ajax_general_action($action, $function)
{
$this->add_ajax_non_logged_in_action($action, $function);
$this->add_ajax_logged_in_action($action, $function);
}

private function add_ajax_actions() {
private function add_ajax_actions()
{
//$this->add_ajax_logged_in_action('my_action', 'example_function');
}

public function example_function() {
public function example_function()
{
//AJAX ACTION CODE
}

}
12 changes: 7 additions & 5 deletions Admin/Crons.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<?php

namespace PluginPlaceholder\Admin;

class Crons {
class Crons
{

protected $plugin_name;
protected $plugin_version;

public function __construct( $plugin_name, $plugin_version ) {
public function __construct($plugin_name, $plugin_version)
{
$this->plugin_name = $plugin_name;
$this->plugin_version = $plugin_version;
$this->add_crons();
}

private function add_crons() {

private function add_crons()
{
}

}
13 changes: 7 additions & 6 deletions Admin/Emails.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
<?php

namespace PluginPlaceholder\Admin;

use PluginPlaceholder\Includes\BladeLoader;

class Emails {
class Emails
{

protected $plugin_name;
protected $plugin_version;

private $blade;

public function __construct( $plugin_name, $plugin_version ) {
public function __construct($plugin_name, $plugin_version)
{
$this->plugin_name = $plugin_name;
$this->plugin_version = $plugin_version;
$this->blade = BladeLoader::getInstance();

$this->send_emails();
}

private function send_emails() {

private function send_emails()
{
}

}
31 changes: 19 additions & 12 deletions Admin/PostActions.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
<?php

namespace PluginPlaceholder\Admin;

class PostActions {
class PostActions
{

protected $plugin_name;
protected $plugin_version;

public function __construct( $plugin_name, $plugin_version ) {
public function __construct($plugin_name, $plugin_version)
{
$this->plugin_name = $plugin_name;
$this->plugin_version = $plugin_version;
$this->add_post_actions();
}

private function add_post_non_logged_in_action($action, $function) {
add_action( "admin_post_nopriv_{$action}", array($this, $function) );

private function add_post_non_logged_in_action($action, $function)
{
add_action("admin_post_nopriv_{$action}", array($this, $function));
}

private function add_post_logged_in_action($action, $function) {
add_action( "admin_post_{$action}", array($this, $function) );

private function add_post_logged_in_action($action, $function)
{
add_action("admin_post_{$action}", array($this, $function));
}

private function add_post_action($action, $function) {
private function add_post_action($action, $function)
{
$this->add_post_non_logged_in_action($action, $function);
$this->add_post_logged_in_action($action, $function);
}

private function add_post_actions() {
private function add_post_actions()
{
//$this->add_post_action($action, 'example_function');
}

public function example_function() {
public function example_function()
{
//POST ACTION CODE
}

}
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
https://www.contributor-covenant.org/translations.
Loading

0 comments on commit e016f99

Please sign in to comment.