all plugin add into includes folder

This commit is contained in:
jorge 2022-03-30 13:11:52 +02:00
parent 62d501b0d2
commit 401828178b
8 changed files with 158 additions and 55 deletions

View File

@ -46,32 +46,22 @@ if ( ! defined( 'WPINC' ) ) {
*/ */
define( 'ARCHIVE_WPPLUGIN_VERSION', '1.1.0' ); define( 'ARCHIVE_WPPLUGIN_VERSION', '1.1.0' );
/* * /* *
* Load translation, if it exists * define Plugin path
* https://developer.wordpress.org/reference/functions/plugin_dir_path/#comment-1113
* * * * * * * * * * * * * * * * * * */ * * * * * * * * * * * * * * * * * * */
define( 'ARCHIVE_WPPLUGIN_PATH', plugin_dir_path( __FILE__ ) );
function arcHIVE_init_textdomain() { include( ARCHIVE_WPPLUGIN_PATH . 'includes/arcHIVE-init-textdomain.php');
$plugin_dir = basename(dirname(__FILE__));
load_plugin_textdomain( 'archive-wpplugin', null, $plugin_dir.'/assets/languages/' );
}
add_action('plugins_loaded', 'arcHIVE_init_textdomain');
/* * include( ARCHIVE_WPPLUGIN_PATH . 'includes/arcHIVE-enable-svg.php');
* Add mimetypes support: svg
* * * * * * * * * * * * * * * * * * */
function arcHIVE_enable_mime_types( $mimes ) { if ( is_admin() ) {
$mimes['svg'] = 'image/svg+xml'; //include_once( plugin_dir_path( __FILE__ ) . 'includes/arcHIVE-admin-stylesheet.php' );
return $mimes; include( ARCHIVE_WPPLUGIN_PATH . 'includes/arcHIVE-admin-stylesheet.php');
} } else {
add_filter('upload_mimes', 'arcHIVE_enable_mime_types'); //include_once( plugin_dir_path( __FILE__ ) . 'includes/arcHIVE-public-stylesheet.php' );
include( ARCHIVE_WPPLUGIN_PATH . 'includes/arcHIVE-public-stylesheet.php');
/**
* Registers stylesheet for a custom plugin.
*/
function arcHIVE_wp_plugin_styles_admin() {
add_editor_style( 'assets/css/arcHIVE-wp-plugin.css' );
} }
add_action( 'admin_init', 'arcHIVE_wp_plugin_styles_admin' );
//include( ARCHIVE_WPPLUGIN_PATH . 'includes/arcHIVE-custom-post-type-resources.php');

View File

@ -1,32 +0,0 @@
/* #bfr_meta{
overflow: hidden;
padding-bottom: 1em;
}
#bfr_meta p{
clear: both;
}
.bfr-row-title{
display: block;
float: left;
width: 200px;
}
.bfr-row-content{
float: left;
padding-bottom: 1em;
}
.bfr-row-content label{
display: block;
line-height: 1.75em;
} */
.button a, .button a:not(.button) {
background-color: transparent !important;
}
.button a:hover, .button a:not(.button):hover {
background-color: transparent !important;
}

View File

@ -0,0 +1,20 @@
/**
* admin css styles.
*
* @link https://arc-hive.zone
* @since 1.1.0
*
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
*/
/**
* admin css styles.
*
* This class defines all code necessary to run during the plugin's activation.
*
* @since 1.1.0
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
* @author Jorge - vitrubio.net <jorge@vitrubio.net>
*/

View File

@ -0,0 +1,20 @@
/**
* public css styles.
*
* @link https://arc-hive.zone
* @since 1.1.0
*
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
*/
/**
* public css styles.
*
* This class defines all code necessary to run during the plugin's activation.
*
* @since 1.1.0
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
* @author Jorge - vitrubio.net <jorge@vitrubio.net>
*/

View File

@ -0,0 +1,26 @@
<?php
/**
* Registers admin stylesheet for a custom plugin.
*
* @link https://arc-hive.zone
* @since 1.1.0
*
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
*/
/**
* Registers admin stylesheet for a custom plugin.
*
* This class defines all code necessary to run during the plugin's activation.
*
* @since 1.1.0
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
* @author Jorge - vitrubio.net <jorge@vitrubio.net>
*/
function arcHIVE_wpplugin_admin_styles() {
add_editor_style( 'assets/css/arcHIVE-wpplugin-admin-styles.css' );
}
add_action( 'admin_init', 'arcHIVE_wpplugin_admin_styles' );

View File

@ -0,0 +1,27 @@
<?php
/**
* Add mimetypes support: svg
*
* @link https://arc-hive.zone
* @since 1.1.0
*
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
*/
/**
* Add mimetypes support: svg
*
* This class defines all code necessary to run during the plugin's activation.
*
* @since 1.1.0
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
* @author Jorge - vitrubio.net <jorge@vitrubio.net>
*/
function arcHIVE_enable_mime_types( $mimes ) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'arcHIVE_enable_mime_types');

View File

@ -0,0 +1,26 @@
<?php
/**
* Load translation, if it exists
*
* @link https://arc-hive.zone
* @since 1.1.0
*
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
*/
/**
* Load translation, if it exists
*
* This class defines all code necessary to run during the plugin's activation.
*
* @since 1.1.0
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
* @author Jorge - vitrubio.net <jorge@vitrubio.net>
*/
function arcHIVE_init_textdomain() {
load_plugin_textdomain( 'archive-wpplugin', null, plugin_dir_path( __FILE__ ).'/assets/languages/' );
}
add_action('plugins_loaded', 'arcHIVE_init_textdomain');

View File

@ -0,0 +1,26 @@
<?php
/**
* Registers public stylesheet for a custom plugin.
*
* @link https://arc-hive.zone
* @since 1.1.0
*
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
*/
/**
* Registers public stylesheet for a custom plugin.
*
* This class defines all code necessary to run during the plugin's activation.
*
* @since 1.1.0
* @package archive_wpplugin
* @subpackage archive_wpplugin/includes
* @author Jorge - vitrubio.net <jorge@vitrubio.net>
*/
function arcHIVE_wpplugin_public_styles() {
add_editor_style( 'assets/css/arcHIVE-wpplugin-styles.css' );
}
add_action( 'admin_init', 'arcHIVE_wpplugin_public_styles' );