Skip to content

Commit

Permalink
feat: remove guidance
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander committed Aug 31, 2020
1 parent afe8b1b commit 5196c43
Showing 1 changed file with 0 additions and 74 deletions.
74 changes: 0 additions & 74 deletions app/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,80 +177,6 @@
echo template('partials.favicon');
});

add_action('init', function () {
if (isset($_GET['post'])) {
$post_id = $_GET['post'];
} elseif (isset($_POST['post_ID'])) {
$post_id = $_POST['post_ID'];
} else {
return;
}
$template_file = get_post_meta($post_id, '_wp_page_template', true);
switch ($template_file) {
case 'views/front-page.blade.php':
case 'views/page-favorites.blade.php':
case 'views/page-my-resources.blade.php':
case 'views/page-saved-searches.blade.php':
case 'views/page-settings.blade.php':
case 'views/term-list.blade.php':
remove_post_type_support('page', 'editor');
break;
default:
break;
}
});

add_action('edit_form_after_title', function () {
if (isset($_GET['post'])) {
$post_id = $_GET['post'];
} elseif (isset($_POST['post_ID'])) {
$post_id = $_POST['post_ID'];
} else {
return;
}
$template_file = get_post_meta($post_id, '_wp_page_template', true);
switch ($template_file) {
case 'views/front-page.blade.php':
echo sprintf(
'<div class="notice notice-warning inline"><p>%s</p></div>',
__('You are currently editing the front page.', 'pcc')
);
break;
case 'views/page-favorites.blade.php':
echo sprintf(
'<div class="notice notice-warning inline"><p>%s</p></div>',
__('You are currently editing the page that displays a user’s favorites.', 'pcc')
);
break;
case 'views/page-my-resources.blade.php':
echo sprintf(
'<div class="notice notice-warning inline"><p>%s</p></div>',
__('You are currently editing the page that displays a user’s saved resources.', 'pcc')
);
break;
case 'views/page-saved-searches.blade.php':
echo sprintf(
'<div class="notice notice-warning inline"><p>%s</p></div>',
__('You are currently editing the page that displays a user’s saved searches.', 'pcc')
);
break;
case 'views/page-settings.blade.php':
echo sprintf(
'<div class="notice notice-warning inline"><p>%s</p></div>',
__('You are currently editing the settings page.', 'pcc')
);
break;
case 'views/term-list.blade.php':
echo sprintf(
'<div class="notice notice-warning inline"><p>%s</p></div>',
__('You are currently editing a page that displays a list of filter terms.', 'pcc')
);
break;
default:
break;
}
});

if (function_exists('\Sober\Intervention\intervention')) {
\Sober\Intervention\intervention('remove-customizer-items', 'custom-css');
\Sober\Intervention\intervention('remove-dashboard-items', ['news', 'welcome']);
Expand Down

0 comments on commit 5196c43

Please sign in to comment.