Skip to content

Commit

Permalink
We were already enqueueing JS and CSS in blocks.php.
Browse files Browse the repository at this point in the history
  • Loading branch information
ideadude committed Jan 14, 2019
1 parent 37d0683 commit 0da4020
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
4 changes: 2 additions & 2 deletions blocks/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ function pmpro_place_blocks_in_panel( $categories, $post ) {
function pmpro_block_editor_scripts() {
// Enqueue the bundled block JS file.
wp_enqueue_script(
'pmpro-blocks-js',
'pmpro-blocks-editor-js',
plugins_url( 'js/editor.blocks.js', PMPRO_BASE_FILE ),
array('wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api', 'wp-editor'),
PMPRO_VERSION
);

// Enqueue optional editor only styles.
wp_enqueue_style(
'pmpro-editor-css',
'pmpro-blocks-editor-css',
plugins_url( 'css/blocks.editor.css', PMPRO_BASE_FILE ),
array(),
PMPRO_VERSION
Expand Down
20 changes: 0 additions & 20 deletions includes/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ function pmpro_init() {
require_once(PMPRO_DIR . '/includes/states.php');
require_once(PMPRO_DIR . '/includes/currencies.php');

// Block styles loaded early in frontend and dashboard.
wp_enqueue_style( 'pmpro_blocks_style', plugins_url( 'css/blocks.style.css', dirname(__FILE__), array(), PMPRO_VERSION, 'screen' ) );

if( is_admin() ) {
// Admin scripts and styles. We could use the admin_enqueue_scripts, but this works too.

Expand All @@ -26,9 +23,6 @@ function pmpro_init() {
));
wp_enqueue_script( 'pmpro_admin' );

// Block styles loaded in the editor only.
wp_enqueue_style( 'pmpro_blocks_editor', plugins_url( 'css/blocks.editor.css', dirname(__FILE__), array(), PMPRO_VERSION, 'screen' ) );

$admin_css_rtl = false;
if(file_exists(get_stylesheet_directory() . "/paid-memberships-pro/css/admin.css")) {
$admin_css = get_stylesheet_directory_uri() . "/paid-memberships-pro/css/admin.css";
Expand Down Expand Up @@ -157,20 +151,6 @@ function pmpro_pages_shortcode($atts, $content=null, $code="")
{
global $pmpro_page_name;
$temp_content = pmpro_loadTemplate($pmpro_page_name, 'local', 'pages');

/*
ob_start();
if(file_exists(get_stylesheet_directory() . "/paid-memberships-pro/pages/" . $pmpro_page_name . ".php"))
include(get_stylesheet_directory() . "/paid-memberships-pro/pages/" . $pmpro_page_name . ".php");
elseif(file_exists(get_template_directory() . "/paid-memberships-pro/pages/" . $pmpro_page_name . ".php"))
include(get_template_directory() . "/paid-memberships-pro/pages/" . $pmpro_page_name . ".php");
else
include(PMPRO_DIR . "/pages/" . $pmpro_page_name . ".php");
$temp_content = ob_get_contents();
// ob_end_clean();
*/
return apply_filters("pmpro_pages_shortcode_" . $pmpro_page_name, $temp_content);
}
add_shortcode("pmpro_" . $pmpro_page_name, "pmpro_pages_shortcode");
Expand Down

0 comments on commit 0da4020

Please sign in to comment.