Compare commits
No commits in common. "master" and "0.18" have entirely different histories.
69
CHANGELOG.md
69
CHANGELOG.md
@ -1,74 +1,5 @@
|
|||||||
# Notice Manager Changelog
|
# Notice Manager Changelog
|
||||||
|
|
||||||
## 0.27
|
|
||||||
|
|
||||||
Release date: Sep 7 2024
|
|
||||||
|
|
||||||
### Dependencies
|
|
||||||
- Composer config: `prepend-autoloader: false` - Give precedence to other composer installations if present.
|
|
||||||
|
|
||||||
## 0.26
|
|
||||||
|
|
||||||
Release date: Sep 1 2024
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Use Mutation Observer instead of deprecated `DOMNodeRemoved` event.
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Add method `NoticeManager.bootstrap()` to initialize Notice manager.
|
|
||||||
|
|
||||||
## 0.25
|
|
||||||
|
|
||||||
Release date: Feb 18 2024
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fix fatal error `Class "WPHelper\MetaBox" not found` due to dependency `abuyoyo/adminmenupage` < 0.29 not requiring dependency `abuyoyo/metabox`.
|
|
||||||
|
|
||||||
### Dependencies
|
|
||||||
- Library WPHelper\AdminPage (`abuyoyo/adminmenupage`) updated to 0.29. Requires `abuyoyo/metabox`.
|
|
||||||
|
|
||||||
## 0.24
|
|
||||||
|
|
||||||
Release date: Oct 4 2023
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Set `WPHelper\PluginCore` option `update_checker` to true. If library Plugin-Update-Checker is installed, allows updates from repo.
|
|
||||||
|
|
||||||
### Dependencies
|
|
||||||
- Library WPHelper\PluginCore (`abuyoyo/plugincore`) updated to 0.27. Supports both Plugin-Update-Checker v5 and v4.
|
|
||||||
|
|
||||||
## 0.23
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fix `.plugin-count` bullet styling issue.
|
|
||||||
- Fix 0-count panel caused by collecting `.hidden` notices.
|
|
||||||
- Fix wrong priority color `.plugin-count` bullet caused by collecting `.hidden` notices.
|
|
||||||
- Fix empty notices-panel removing all screen-meta-link panels.
|
|
||||||
|
|
||||||
## 0.22
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Do not collect `.theme-info` notices.
|
|
||||||
- Fix `vendor/autoload` include path.
|
|
||||||
|
|
||||||
## 0.21
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fix PHP 8.2 deprecated optional parameter before required parameter. Fixed upstream in `abuyoyo/screen-meta-links ~0.13`.
|
|
||||||
|
|
||||||
### Dependencies
|
|
||||||
- Update library `abuyoyo/screen-meta-links` to version 0.13.
|
|
||||||
|
|
||||||
## 0.20
|
|
||||||
|
|
||||||
### Minor
|
|
||||||
- Just another version bump (composer.json as well).
|
|
||||||
|
|
||||||
## 0.19
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Add 'Distraction Free' option.
|
|
||||||
|
|
||||||
## 0.18
|
## 0.18
|
||||||
|
|
||||||
### Minor
|
### Minor
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "abuyoyo/notice-manager",
|
"name": "abuyoyo/notice-manager",
|
||||||
"description": "Manage notices on WordPress admin pages. Adds 'Notices' screen-meta-link.",
|
"description": "Manage notices on WordPress admin pages. Adds 'Notices' screen-meta-link.",
|
||||||
"type": "wordpress-plugin",
|
"type": "wordpress-plugin",
|
||||||
"version": "0.27",
|
"version": "0.18",
|
||||||
"repositories": [
|
"repositories": [
|
||||||
{
|
{
|
||||||
"type": "vcs",
|
"type": "vcs",
|
||||||
@ -10,11 +10,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require":{
|
"require":{
|
||||||
"abuyoyo/screen-meta-links": "~0.13",
|
"abuyoyo/screen-meta-links": "~0.11",
|
||||||
"abuyoyo/plugincore": "~0.27",
|
"abuyoyo/plugincore": "~0.23",
|
||||||
"abuyoyo/adminmenupage": "~0.29"
|
"abuyoyo/adminmenupage": "~0.21"
|
||||||
},
|
|
||||||
"config": {
|
|
||||||
"prepend-autoloader": false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
82
composer.lock
generated
82
composer.lock
generated
@ -4,27 +4,24 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "b1a74cf1316f5dd317f70efeb60d9f4d",
|
"content-hash": "c7eb351b97392f663e147702dbc845b9",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "abuyoyo/adminmenupage",
|
"name": "abuyoyo/adminmenupage",
|
||||||
"version": "0.29",
|
"version": "0.21",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/abuyoyo/AdminMenuPage.git",
|
"url": "https://github.com/abuyoyo/AdminMenuPage.git",
|
||||||
"reference": "4cd47d5217ca25ed17af76f5fdbab3cab3b37ef8"
|
"reference": "d05a9e9977d7e7c4ba3c913993493fefba4359d6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/abuyoyo/AdminMenuPage/zipball/4cd47d5217ca25ed17af76f5fdbab3cab3b37ef8",
|
"url": "https://api.github.com/repos/abuyoyo/AdminMenuPage/zipball/d05a9e9977d7e7c4ba3c913993493fefba4359d6",
|
||||||
"reference": "4cd47d5217ca25ed17af76f5fdbab3cab3b37ef8",
|
"reference": "d05a9e9977d7e7c4ba3c913993493fefba4359d6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
|
||||||
"abuyoyo/metabox": "~0.8"
|
|
||||||
},
|
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"abuyoyo/plugincore": "~0.26",
|
"abuyoyo/plugincore": "~0.18",
|
||||||
"cmb2/cmb2": "~2.9"
|
"cmb2/cmb2": "~2.9"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
@ -43,58 +40,27 @@
|
|||||||
"description": "WordPress admin menu page helper class",
|
"description": "WordPress admin menu page helper class",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/abuyoyo/AdminMenuPage/issues",
|
"issues": "https://github.com/abuyoyo/AdminMenuPage/issues",
|
||||||
"source": "https://github.com/abuyoyo/AdminMenuPage/tree/0.29"
|
"source": "https://github.com/abuyoyo/AdminMenuPage/tree/0.21"
|
||||||
},
|
},
|
||||||
"time": "2023-10-05T00:00:00+00:00"
|
"time": "2022-08-06T13:42:37+00:00"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "abuyoyo/metabox",
|
|
||||||
"version": "0.8",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/abuyoyo/MetaBox.git",
|
|
||||||
"reference": "98cb4c30db4c366c0d273985eb9c31ffa1cd78f9"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/abuyoyo/MetaBox/zipball/98cb4c30db4c366c0d273985eb9c31ffa1cd78f9",
|
|
||||||
"reference": "98cb4c30db4c366c0d273985eb9c31ffa1cd78f9",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"WPHelper\\": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"description": "WordPress metabox helper class",
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/abuyoyo/MetaBox/issues",
|
|
||||||
"source": "https://github.com/abuyoyo/MetaBox/tree/0.8"
|
|
||||||
},
|
|
||||||
"time": "2023-07-18T19:14:03+00:00"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "abuyoyo/plugincore",
|
"name": "abuyoyo/plugincore",
|
||||||
"version": "0.27",
|
"version": "0.23",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/abuyoyo/PluginCore.git",
|
"url": "https://github.com/abuyoyo/PluginCore.git",
|
||||||
"reference": "d730a674cbe2dc92e60ace8e25a2e0e3fdeee3e6"
|
"reference": "0a5809d6722a2abf0bdaf23f73bd3875b00fd2a4"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/abuyoyo/PluginCore/zipball/d730a674cbe2dc92e60ace8e25a2e0e3fdeee3e6",
|
"url": "https://api.github.com/repos/abuyoyo/PluginCore/zipball/0a5809d6722a2abf0bdaf23f73bd3875b00fd2a4",
|
||||||
"reference": "d730a674cbe2dc92e60ace8e25a2e0e3fdeee3e6",
|
"reference": "0a5809d6722a2abf0bdaf23f73bd3875b00fd2a4",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"abuyoyo/adminmenupage": "~0.27",
|
"abuyoyo/adminmenupage": "~0.20",
|
||||||
"yahnis-elsts/plugin-update-checker": "~5.2"
|
"yahnis-elsts/plugin-update-checker": "~4.12"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -109,22 +75,22 @@
|
|||||||
"description": "WordPress plugin core helper class",
|
"description": "WordPress plugin core helper class",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/abuyoyo/PluginCore/issues",
|
"issues": "https://github.com/abuyoyo/PluginCore/issues",
|
||||||
"source": "https://github.com/abuyoyo/PluginCore/tree/0.27"
|
"source": "https://github.com/abuyoyo/PluginCore/tree/0.23"
|
||||||
},
|
},
|
||||||
"time": "2022-10-03T00:00:00+00:00"
|
"time": "2022-08-06T00:00:00+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "abuyoyo/screen-meta-links",
|
"name": "abuyoyo/screen-meta-links",
|
||||||
"version": "0.13",
|
"version": "0.11",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/abuyoyo/screen-meta-links.git",
|
"url": "https://github.com/abuyoyo/screen-meta-links.git",
|
||||||
"reference": "b324cef9eb5825d04ffa17f771237b7deca5cd01"
|
"reference": "04e3c892f0c6095b4c31a489e06336f0917128d3"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/abuyoyo/screen-meta-links/zipball/b324cef9eb5825d04ffa17f771237b7deca5cd01",
|
"url": "https://api.github.com/repos/abuyoyo/screen-meta-links/zipball/04e3c892f0c6095b4c31a489e06336f0917128d3",
|
||||||
"reference": "b324cef9eb5825d04ffa17f771237b7deca5cd01",
|
"reference": "04e3c892f0c6095b4c31a489e06336f0917128d3",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
@ -135,10 +101,10 @@
|
|||||||
},
|
},
|
||||||
"description": "API for adding custom screen-meta-links alongside the 'Screen Options' and 'Help' links.",
|
"description": "API for adding custom screen-meta-links alongside the 'Screen Options' and 'Help' links.",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/abuyoyo/screen-meta-links/tree/0.13",
|
"source": "https://github.com/abuyoyo/screen-meta-links/tree/0.11",
|
||||||
"issues": "https://github.com/abuyoyo/screen-meta-links/issues"
|
"issues": "https://github.com/abuyoyo/screen-meta-links/issues"
|
||||||
},
|
},
|
||||||
"time": "2023-08-08T22:37:03+00:00"
|
"time": "2022-05-18T01:18:24+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [],
|
"packages-dev": [],
|
||||||
@ -146,8 +112,8 @@
|
|||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": [],
|
"stability-flags": [],
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": true,
|
"prefer-lowest": false,
|
||||||
"platform": [],
|
"platform": [],
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"plugin-api-version": "2.3.0"
|
"plugin-api-version": "2.1.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,181 +2,160 @@
|
|||||||
* NoticeManager class/module
|
* NoticeManager class/module
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const NoticeManager = function ($) {
|
var NoticeManager = (function ($, document) {
|
||||||
|
let options = window.notice_manager_options;
|
||||||
|
|
||||||
const selectors_notice = [
|
let selectors_notice = [
|
||||||
"div.notice",
|
"div.notice",
|
||||||
"div.updated",
|
"div.updated",
|
||||||
]
|
];
|
||||||
|
|
||||||
const selectors_warning = [
|
let selectors_warning = [
|
||||||
"div.notice-warning",
|
"div.notice-warning",
|
||||||
"div.update-nag",
|
"div.update-nag",
|
||||||
]
|
];
|
||||||
|
|
||||||
const selectors_error = [
|
let selectors_error = [
|
||||||
"div.error",
|
"div.error",
|
||||||
"div.notice-error",
|
"div.notice-error",
|
||||||
]
|
];
|
||||||
|
|
||||||
const selectors_all = selectors_notice.concat(selectors_warning, selectors_error)
|
let selectors_all = selectors_notice.concat(selectors_warning, selectors_error);
|
||||||
|
|
||||||
const selectors_skip = [
|
|
||||||
".inline",
|
|
||||||
".below-h2",
|
|
||||||
".theme-info .notice",
|
|
||||||
".hidden",
|
|
||||||
]
|
|
||||||
|
|
||||||
// wait function used with autoCollapse
|
// wait function used with autoCollapse
|
||||||
const wait = function (ms) {
|
let wait = function (ms) {
|
||||||
var dfd = $.Deferred()
|
var dfd = $.Deferred();
|
||||||
setTimeout(dfd.resolve, ms) //callback, timeout till callback
|
setTimeout(dfd.resolve, ms); //callback, timeout till callback
|
||||||
return dfd.promise()
|
return dfd.promise();
|
||||||
}
|
};
|
||||||
|
|
||||||
const options = window.notice_manager_options
|
let notices;
|
||||||
|
|
||||||
let notices
|
let button;
|
||||||
|
let panel;
|
||||||
|
let haveClosed; // set to true on first close/collect
|
||||||
|
let dismissNoticesButton;
|
||||||
|
|
||||||
let button
|
// bootstrap
|
||||||
let panel
|
// some of these need to run BEFORE document.ready - don't know why really
|
||||||
let dismissNoticesButton
|
button = $("#meta-link-notices");
|
||||||
|
panel = $("#meta-link-notices-wrap");
|
||||||
|
haveClosed = false;
|
||||||
|
dismissNoticesButton = $("#meta-link-notices-wrap button.notice-dismiss");
|
||||||
|
|
||||||
let haveClosed // set to true on first close/collect
|
dismissNoticesButton.on("click", () => {
|
||||||
let panelObserver
|
screenMeta.close(panel, button);
|
||||||
|
if (! haveClosed){
|
||||||
|
NoticeManager.collectNotices();
|
||||||
|
}
|
||||||
|
NoticeManager.addCounter();
|
||||||
|
});
|
||||||
|
|
||||||
|
//original wp focus on click function
|
||||||
|
button.on("focus.scroll-into-view", (e) => {
|
||||||
|
if (e.target.scrollIntoView) e.target.scrollIntoView(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
// scroll page to top when closing notice panel
|
||||||
|
// function used to work with $(this)
|
||||||
|
// using e.target instead
|
||||||
|
// not sure if this should perhaps be e.currentTarget
|
||||||
|
button.on("click", (e) => {
|
||||||
|
if ($(e.target).hasClass("screen-meta-active")) {
|
||||||
|
if (haveClosed) {
|
||||||
|
NoticeManager.addCounter();
|
||||||
|
}
|
||||||
|
|
||||||
|
// $(window).scrollTop(true);
|
||||||
|
} else {
|
||||||
|
NoticeManager.removeCounter();
|
||||||
|
|
||||||
|
// wait (500).then(function(){ //still jumpy sometimes - but scrolls to correct position 400 ~ 600
|
||||||
|
// $(window).scrollTop(true);
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* document.on.ready
|
||||||
|
*/
|
||||||
|
$(() => {
|
||||||
|
|
||||||
|
console.log("NoticeManager.on.ready");
|
||||||
|
console.log("options");
|
||||||
|
console.log(options);
|
||||||
|
|
||||||
|
// bootstrap notices
|
||||||
|
// get all notices that are not explicitly marked as `.inline` or `.below-h2`
|
||||||
|
// we add .update-nag.inline for WordPress Update notice
|
||||||
|
notices = $( selectors_all.join(', ') )
|
||||||
|
.not(".inline, .below-h2")
|
||||||
|
.add("div.update-nag");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove panel if there are no notices on this page
|
||||||
|
*/
|
||||||
|
if (options.screen_panel) {
|
||||||
|
NoticeManager.maybeRemoveNoticesPanel();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.screen_panel && options.auto_collect) {
|
||||||
|
NoticeManager.collectNotices();
|
||||||
|
} else {
|
||||||
|
if (options.above_title) {
|
||||||
|
NoticeManager.moveAboveTitle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* auto-open notices panel
|
||||||
|
*/
|
||||||
|
if (button.length) {
|
||||||
|
panel.toggle();
|
||||||
|
button.addClass("screen-meta-active");
|
||||||
|
screenMeta.open(panel, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* auto-close notices panel after short delay
|
||||||
|
* only auto-close if we have collected notices previously
|
||||||
|
* only auto-close if no error messages
|
||||||
|
*/
|
||||||
|
if (options.auto_collapse) {
|
||||||
|
wait(4000).then(() => {
|
||||||
|
if (haveClosed && NoticeManager.getNoticesTopPriority() != 'error') {
|
||||||
|
screenMeta.close(panel, button);
|
||||||
|
NoticeManager.addCounter();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}); // end document.on.ready
|
||||||
|
|
||||||
|
// prevent jumpy scrollRestoration on reload page
|
||||||
|
// fixed below on 'beforeunload'
|
||||||
|
// if (history.scrollRestoration) {
|
||||||
|
// history.scrollRestoration = 'manual';
|
||||||
|
//}
|
||||||
|
/**
|
||||||
|
* Set history.scrollTop to prevent jump on page refresh when scrollRestoration = auto
|
||||||
|
*/
|
||||||
|
$(window).on("beforeunload", () => {
|
||||||
|
history.pushState(
|
||||||
|
{ scrollTop: document.body.scrollTop },
|
||||||
|
document.title,
|
||||||
|
document.location.pathname
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
bootstrap: () => {
|
|
||||||
|
|
||||||
// Init selectors
|
|
||||||
button = $("#meta-link-notices")
|
|
||||||
panel = $("#meta-link-notices-wrap")
|
|
||||||
dismissNoticesButton = $("#meta-link-notices-wrap button.notice-dismiss")
|
|
||||||
|
|
||||||
// bootstrap notices
|
|
||||||
// get all notices that are not explicitly marked as `.inline` or `.below-h2`
|
|
||||||
// we add .update-nag.inline for WordPress Update notice
|
|
||||||
notices = $(selectors_all.join(', '))
|
|
||||||
.not(selectors_skip.join(', '))
|
|
||||||
.add("div.update-nag")
|
|
||||||
|
|
||||||
// Set state
|
|
||||||
haveClosed = false
|
|
||||||
|
|
||||||
dismissNoticesButton.on("click", () => {
|
|
||||||
screenMeta.close(panel, button)
|
|
||||||
if (!haveClosed) {
|
|
||||||
NoticeManager.collectNotices()
|
|
||||||
}
|
|
||||||
NoticeManager.addCounter()
|
|
||||||
})
|
|
||||||
|
|
||||||
//original wp focus on click function
|
|
||||||
button.on("focus.scroll-into-view", (e) => {
|
|
||||||
if (e.target.scrollIntoView) e.target.scrollIntoView(false)
|
|
||||||
})
|
|
||||||
|
|
||||||
// scroll page to top when closing notice panel
|
|
||||||
// function used to work with $(this)
|
|
||||||
// using e.target instead
|
|
||||||
// not sure if this should perhaps be e.currentTarget
|
|
||||||
button.on("click", (e) => {
|
|
||||||
if ($(e.target).hasClass("screen-meta-active")) {
|
|
||||||
if (haveClosed) {
|
|
||||||
NoticeManager.addCounter()
|
|
||||||
}
|
|
||||||
|
|
||||||
// $(window).scrollTop(true)
|
|
||||||
} else {
|
|
||||||
NoticeManager.removeCounter()
|
|
||||||
|
|
||||||
// wait (500).then(function(){ //still jumpy sometimes - but scrolls to correct position 400 ~ 600
|
|
||||||
// $(window).scrollTop(true)
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// prevent jumpy scrollRestoration on reload page
|
|
||||||
// fixed below on 'beforeunload'
|
|
||||||
// if (history.scrollRestoration) {
|
|
||||||
// history.scrollRestoration = 'manual'
|
|
||||||
//}
|
|
||||||
/**
|
|
||||||
* Set history.scrollTop to prevent jump on page refresh when scrollRestoration = auto
|
|
||||||
*/
|
|
||||||
$(window).on('beforeunload', () => history.pushState(
|
|
||||||
{ scrollTop: document.body.scrollTop },
|
|
||||||
document.title,
|
|
||||||
document.location.pathname
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove panel if there are no notices on this page
|
|
||||||
*/
|
|
||||||
if (options.screen_panel) {
|
|
||||||
NoticeManager.maybeRemoveNoticesPanel()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.screen_panel && options.auto_collect) {
|
|
||||||
NoticeManager.collectNotices()
|
|
||||||
} else {
|
|
||||||
if (options.above_title) {
|
|
||||||
NoticeManager.moveAboveTitle()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* auto-open notices panel
|
|
||||||
*/
|
|
||||||
if (button.length && !options.distraction_free) {
|
|
||||||
panel.toggle()
|
|
||||||
button.addClass("screen-meta-active")
|
|
||||||
screenMeta.open(panel, button)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* auto-close notices panel after short delay
|
|
||||||
* only auto-close if we have collected notices previously
|
|
||||||
* only auto-close if no error messages
|
|
||||||
*/
|
|
||||||
if (options.auto_collapse && !options.distraction_free) {
|
|
||||||
wait(4000).then(() => {
|
|
||||||
if (haveClosed && NoticeManager.getNoticesTopPriority() != 'error') {
|
|
||||||
screenMeta.close(panel, button)
|
|
||||||
NoticeManager.addCounter()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.distraction_free) {
|
|
||||||
NoticeManager.addCounterWhenClosed()
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
getNotices: () => notices,
|
getNotices: () => notices,
|
||||||
|
|
||||||
getNoticesTopPriority: () => {
|
getNoticesTopPriority: () => {
|
||||||
if (notices.filter(":visible").filter(selectors_error.join(", ")).length)
|
if (notices.filter(":visible").filter(selectors_error.join(", ")).length)
|
||||||
return 'error'
|
return 'error';
|
||||||
if (notices.filter(":visible").filter(selectors_warning.join(", ")).length)
|
if (notices.filter(":visible").filter(selectors_warning.join(", ")).length)
|
||||||
return 'warning'
|
return 'warning';
|
||||||
return 'info'
|
return 'notice';
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* .filter(":visible") unreliable when closed
|
|
||||||
*
|
|
||||||
* @returns {string} top priority
|
|
||||||
*/
|
|
||||||
getNoticesTopPriorityWhenClosed: () => {
|
|
||||||
if (notices.filter(selectors_error.join(", ")).length)
|
|
||||||
return 'error'
|
|
||||||
if (notices.filter(selectors_warning.join(", ")).length)
|
|
||||||
return 'warning'
|
|
||||||
return 'info'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -184,50 +163,39 @@ const NoticeManager = function ($) {
|
|||||||
* Remove dismiss-notices button.
|
* Remove dismiss-notices button.
|
||||||
*/
|
*/
|
||||||
collectNotices: () => {
|
collectNotices: () => {
|
||||||
notices.appendTo(".notice_container").eq(0)
|
notices.appendTo(".notice_container").eq(0);
|
||||||
$(".notice_container").removeClass("empty") // .empty removes padding
|
$(".notice_container").removeClass("empty"); // .empty removes padding
|
||||||
|
|
||||||
haveClosed = true // initial collection has occurred.
|
haveClosed = true; // initial collection has occurred.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When dismissible notices are dismissed, check if any notices are left on page.
|
* When dismissible notices are dismissed, check if any notices are left on page.
|
||||||
* If no notices are left - remove Notice Panel entirely
|
* If no notices are left - remove Notice Panel entirely
|
||||||
*/
|
*/
|
||||||
panelObserver = new MutationObserver(() => {
|
$(document).on(
|
||||||
notices = panel
|
"DOMNodeRemoved",
|
||||||
.find(selectors_all.join(", "))
|
"#meta-link-notices-wrap div.notice",
|
||||||
.filter(":visible")
|
() => {
|
||||||
NoticeManager.maybeRemoveNoticesPanel()
|
notices = panel
|
||||||
});
|
.find(selectors_all.join(", "))
|
||||||
panelObserver.observe(panel.get(0), { childList: true, subtree: true }); // only run once
|
.filter(":visible");
|
||||||
|
NoticeManager.maybeRemoveNoticesPanel();
|
||||||
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
addCounter: () => {
|
addCounter: () => {
|
||||||
if (!button.children('.plugin-count').length) {
|
if (!button.children('.plugin-count').length){
|
||||||
button.append(
|
button.append(
|
||||||
$("<span/>").text(notices.filter(":visible").length).attr({
|
$("<span/>").text(notices.filter(":visible").length).attr({
|
||||||
class: "plugin-count",
|
class: "plugin-count",
|
||||||
}).addClass(NoticeManager.getNoticesTopPriority())
|
}).addClass(NoticeManager.getNoticesTopPriority())
|
||||||
)
|
);
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* cannot rely on filter(:visible)
|
|
||||||
*/
|
|
||||||
addCounterWhenClosed: () => {
|
|
||||||
if (!button.children('.plugin-count').length) {
|
|
||||||
button.append(
|
|
||||||
$("<span/>").text(notices.length).attr({
|
|
||||||
class: "plugin-count",
|
|
||||||
}).addClass(NoticeManager.getNoticesTopPriorityWhenClosed())
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
removeCounter: () => {
|
removeCounter: () => {
|
||||||
button.children(".plugin-count").remove()
|
button.children(".plugin-count").remove();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -236,14 +204,13 @@ const NoticeManager = function ($) {
|
|||||||
*/
|
*/
|
||||||
maybeRemoveNoticesPanel: () => {
|
maybeRemoveNoticesPanel: () => {
|
||||||
if (!notices.length) {
|
if (!notices.length) {
|
||||||
screenMeta.close(panel, button)
|
screenMeta.close(panel, button);
|
||||||
|
|
||||||
$("#meta-link-notices-link-wrap").detach()
|
$("#meta-link-notices-link-wrap").detach();
|
||||||
$("#meta-link-notices-wrap").detach()
|
$("#meta-link-notices-wrap").detach();
|
||||||
|
|
||||||
if ($("#screen-meta-links").children().length == 0) {
|
if (!$("#screen-meta-links").children().length)
|
||||||
$("#screen-meta-links").detach()
|
$("#screen-meta-links").detach();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -253,9 +220,7 @@ const NoticeManager = function ($) {
|
|||||||
* I HATE it when WordPress moves notices below title.
|
* I HATE it when WordPress moves notices below title.
|
||||||
*/
|
*/
|
||||||
moveAboveTitle: () => {
|
moveAboveTitle: () => {
|
||||||
notices.insertBefore(".wrap:first")
|
notices.insertBefore(".wrap:first");
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
}(jQuery);
|
}(jQuery,document) )
|
||||||
|
|
||||||
jQuery(NoticeManager.bootstrap);
|
|
||||||
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Plugin Name: Notice Manager
|
* Plugin Name: Notice Manager
|
||||||
* Description: Manage notices on WordPress admin pages. Adds 'Notices' screen-meta-link panel to collect notices from page.
|
* Description: Manage notices on WordPress admin pages. Adds 'Notices' screen-meta-link.
|
||||||
* Version: 0.27
|
* Version: 0.18
|
||||||
* Author: abuyoyo
|
* Author: abuyoyo
|
||||||
* Author URI: https://github.com/abuyoyo/
|
* Author URI: https://github.com/abuyoyo/
|
||||||
* Plugin URI: https://github.com/abuyoyo/notice-manager
|
* Plugin URI: https://github.com/abuyoyo/notice-manager
|
||||||
@ -10,25 +10,10 @@
|
|||||||
*/
|
*/
|
||||||
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
||||||
|
|
||||||
/**
|
|
||||||
* Dependencies
|
|
||||||
* Allow all other auto-loaders to fail before including our own.
|
|
||||||
*/
|
|
||||||
if (
|
|
||||||
! class_exists( 'WPHelper\PluginCore' )
|
|
||||||
||
|
|
||||||
! class_exists( 'WPHelper\AdminPage' )
|
|
||||||
||
|
|
||||||
! function_exists( 'wph_add_screen_meta_panel' )
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ){
|
|
||||||
require_once __DIR__ . '/vendor/autoload.php';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
use WPHelper\PluginCore;
|
use WPHelper\PluginCore;
|
||||||
|
|
||||||
|
require_once 'vendor/autoload.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bootstrap plugin and admin page (Tools > Notice Manager)
|
* Bootstrap plugin and admin page (Tools > Notice Manager)
|
||||||
*/
|
*/
|
||||||
@ -44,7 +29,7 @@ new PluginCore(
|
|||||||
'admin_page' => [
|
'admin_page' => [
|
||||||
'parent' => 'options',
|
'parent' => 'options',
|
||||||
'render' => 'settings-page', // built-in settings page
|
'render' => 'settings-page', // built-in settings page
|
||||||
// 'plugin_info' => true, // disable on public repo
|
'plugin_info' => true,
|
||||||
'settings' => [
|
'settings' => [
|
||||||
'option_name' => 'notice_manager', // option_name used in wp_options table
|
'option_name' => 'notice_manager', // option_name used in wp_options table
|
||||||
'sections' => [
|
'sections' => [
|
||||||
@ -77,19 +62,12 @@ new PluginCore(
|
|||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'description' => 'If auto-collect is enabled - Notices panel will stay open for a few seconds on page load, and then close automatically. Panel will not auto-collapse if it contains `error` level notices.',
|
'description' => 'If auto-collect is enabled - Notices panel will stay open for a few seconds on page load, and then close automatically. Panel will not auto-collapse if it contains `error` level notices.',
|
||||||
],
|
],
|
||||||
[
|
]
|
||||||
'id' => 'distraction_free',
|
]
|
||||||
'title' => 'Distraction Free',
|
]
|
||||||
'type' => 'checkbox',
|
]
|
||||||
'description' => 'Notice Panel is closed on page load. Requires auto_collect.'
|
]
|
||||||
],
|
]
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'update_checker' => true, // If Plugin Update Checker library is available - allow updates/auto-updates.
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
|
|
||||||
require_once 'src/NoticeManager.php';
|
require_once 'src/NoticeManager.php';
|
||||||
|
|||||||
81
vendor/abuyoyo/adminmenupage/CHANGELOG.md
vendored
81
vendor/abuyoyo/adminmenupage/CHANGELOG.md
vendored
@ -1,83 +1,6 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
WPHelper\AdminMenuPage
|
WPHelper\AdminMenuPage
|
||||||
|
|
||||||
## 0.29
|
|
||||||
Release date: Oct 5 2023
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- `composer.json` - Require `abuyoyo/metabox`. WPHelper\Metabox has been a required library since 0.25.
|
|
||||||
|
|
||||||
### Dependencies
|
|
||||||
- lib: WPHelper\Metabox (`abuyoyo/metabox`) ~0.8.
|
|
||||||
|
|
||||||
## 0.28
|
|
||||||
Release date: Oct 4 2023
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Option `parent` accepts `tools` as shorthand for `tools.php`.
|
|
||||||
- Add link to Install Plugin page in "CMB2 plugin missing" template.
|
|
||||||
|
|
||||||
## 0.27
|
|
||||||
Release date: Sep 10 2023
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fix nav-tabs appearing on pages without `tab_group`.
|
|
||||||
|
|
||||||
## 0.26
|
|
||||||
Release date: Jun 20 2023
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Add `allow_on_front` setting to CMB2 pages. Hooks metabox on `cmb2_init` instead of `cmb2_admin_init`.
|
|
||||||
- If defined `WPH_DEBUG` add WPHelper classes debug information to plugin info meta box.
|
|
||||||
|
|
||||||
## 0.25
|
|
||||||
Release date: Jun 9 2023
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Non-CMB2 pages can be added to CMB2 tab groups. New options `tab_group` and `tab_title`
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- New method `render_plugin_info_meta_box`. Deprecate `render_plugin_info_box`.
|
|
||||||
- Plugin info meta box rendered using `WPHelper\MetaBox`.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fix several PHP undefined variable warnings.
|
|
||||||
|
|
||||||
### Internal
|
|
||||||
- Setting pages/wrap template uses WordPress Core `do_meta_boxes` to render `side` meta boxes div.
|
|
||||||
- Add variables to `AdminPage::options()` array.
|
|
||||||
- Multiple code refactoring and template restructuring.
|
|
||||||
|
|
||||||
## 0.24
|
|
||||||
Release date: Jan 28 2023
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fix plugin info meta box when no PluginCore is available.
|
|
||||||
- Fix PHP deprecated notice.
|
|
||||||
|
|
||||||
## 0.23
|
|
||||||
Release date: Jan 15 2023
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Add action hook `wphelper/plugin_info_meta_box/{$slug}` to modify and render plugin info meta box.
|
|
||||||
- Add support for `textarea` input field in SettingsPage.
|
|
||||||
- Add `sanitize_callback` option - allow plugins to supply their own sanitize function.
|
|
||||||
- Add `render` to fields - allow plugins to supply their own render callback for fields.
|
|
||||||
- Add `placeholder` to fields - allow plugins to supply placeholder values for fields.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fix default value handling for fields.
|
|
||||||
|
|
||||||
### Internal
|
|
||||||
- Rename `tpl/` template parts.
|
|
||||||
- Minor changes and fixes.
|
|
||||||
|
|
||||||
## 0.22
|
|
||||||
Release date: Jan 1 2023
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fix error when `plugin_info = true` but `plugin_core` is not set.
|
|
||||||
|
|
||||||
## 0.21
|
## 0.21
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
@ -86,7 +9,7 @@ Release date: Jan 1 2023
|
|||||||
## 0.20
|
## 0.20
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Add SettingsPage section option `description-container`. Accepts `card` div, `notice`, `notice-info` and `none`.
|
- Add SettingsPage section option `desciption-container`. Accepts `card` div, `notice`, `notice-info` and `none`.
|
||||||
- Sanitize SettingsPage text, url and email fields.
|
- Sanitize SettingsPage text, url and email fields.
|
||||||
|
|
||||||
## 0.19
|
## 0.19
|
||||||
@ -96,7 +19,7 @@ Release date: Jan 1 2023
|
|||||||
- CMB2_OptionsPage supports all admin menu top-level slugs.
|
- CMB2_OptionsPage supports all admin menu top-level slugs.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fix PHP fatal error: cannot redeclare function `wph_extra_plugin_headers()`.
|
- Fixed PHP fatal error: cannot redeclare function `wph_extra_plugin_headers()`.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- If CMB2 plugin is not activated - show missing plugin card on `cmb2` and `cmb2-tabs` pages.
|
- If CMB2 plugin is not activated - show missing plugin card on `cmb2` and `cmb2-tabs` pages.
|
||||||
|
|||||||
3
vendor/abuyoyo/adminmenupage/README.md
vendored
3
vendor/abuyoyo/adminmenupage/README.md
vendored
@ -40,13 +40,14 @@ $args = [
|
|||||||
'icon_url' => $icon_url; // optional - icon url passed to add_menu_page/add_submenu_page
|
'icon_url' => $icon_url; // optional - icon url passed to add_menu_page/add_submenu_page
|
||||||
'position' => 4; // optional - passed to add_menu_page
|
'position' => 4; // optional - passed to add_menu_page
|
||||||
'scripts' => [ // optional - script parameters passed to enqueue_scripts. Will only enqueue scripts on admin page
|
'scripts' => [ // optional - script parameters passed to enqueue_scripts. Will only enqueue scripts on admin page
|
||||||
[ 'script_handle', 'js/my_script.js', ['jquery'], false, true ],
|
[ 'script_handle', 'js/myscript.js', ['jquery'], false, true ],
|
||||||
[ 'another_script', 'js/my_other_script.js', ['jquery', 'script_handle'], false, true ]
|
[ 'another_script', 'js/my_other_script.js', ['jquery', 'script_handle'], false, true ]
|
||||||
];
|
];
|
||||||
];
|
];
|
||||||
|
|
||||||
// Register the admin menu page.
|
// Register the admin menu page.
|
||||||
$admin_menu_page = new AdminPage( $args );
|
$admin_menu_page = new AdminPage( $args );
|
||||||
|
$admin_menu_page->setup();
|
||||||
|
|
||||||
// That's it. We're done.
|
// That's it. We're done.
|
||||||
// This function can be called from anywhere. No need to wrap in any hook.
|
// This function can be called from anywhere. No need to wrap in any hook.
|
||||||
|
|||||||
8
vendor/abuyoyo/adminmenupage/composer.json
vendored
8
vendor/abuyoyo/adminmenupage/composer.json
vendored
@ -2,14 +2,10 @@
|
|||||||
"name": "abuyoyo/adminmenupage",
|
"name": "abuyoyo/adminmenupage",
|
||||||
"description": "WordPress admin menu page helper class",
|
"description": "WordPress admin menu page helper class",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"version": "0.29",
|
"version": "0.21",
|
||||||
"time": "2023-10-05",
|
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"require": {
|
|
||||||
"abuyoyo/metabox": "~0.8"
|
|
||||||
},
|
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"abuyoyo/plugincore": "~0.26",
|
"abuyoyo/plugincore": "~0.18",
|
||||||
"cmb2/cmb2": "~2.9"
|
"cmb2/cmb2": "~2.9"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ namespace WPHelper;
|
|||||||
|
|
||||||
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
||||||
|
|
||||||
if ( ! class_exists( AdminMenuPage::class ) ):
|
if ( ! class_exists( 'WPHelper\AdminMenuPage' ) ):
|
||||||
/**
|
/**
|
||||||
* AdminMenuPage
|
* AdminMenuPage
|
||||||
*
|
*
|
||||||
|
|||||||
303
vendor/abuyoyo/adminmenupage/src/AdminPage.php
vendored
303
vendor/abuyoyo/adminmenupage/src/AdminPage.php
vendored
@ -1,15 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace WPHelper;
|
namespace WPHelper;
|
||||||
|
|
||||||
use CMB2_Options_Hookup;
|
|
||||||
|
|
||||||
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
||||||
|
|
||||||
use function add_menu_page;
|
use function add_menu_page;
|
||||||
use function add_options_page;
|
use function add_options_page;
|
||||||
use function add_submenu_page;
|
use function add_submenu_page;
|
||||||
|
|
||||||
if ( ! class_exists( AdminPage::class ) ):
|
if ( ! class_exists( 'WPHelper\AdminPage' ) ):
|
||||||
/**
|
/**
|
||||||
* AdminPage
|
* AdminPage
|
||||||
*
|
*
|
||||||
@ -108,20 +106,6 @@ class AdminPage
|
|||||||
*/
|
*/
|
||||||
protected $wrap;
|
protected $wrap;
|
||||||
|
|
||||||
/**
|
|
||||||
* Tab Group
|
|
||||||
*
|
|
||||||
* @var string CMB2 tab group
|
|
||||||
*/
|
|
||||||
protected $tab_group;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tab Title
|
|
||||||
*
|
|
||||||
* @var string CMB2 tab title
|
|
||||||
*/
|
|
||||||
protected $tab_title;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render callback function.
|
* Render callback function.
|
||||||
*
|
*
|
||||||
@ -136,13 +120,6 @@ class AdminPage
|
|||||||
*/
|
*/
|
||||||
protected $scripts;
|
protected $scripts;
|
||||||
|
|
||||||
/**
|
|
||||||
* Settings
|
|
||||||
*
|
|
||||||
* @var array[] arrays of settings sections and fields
|
|
||||||
*/
|
|
||||||
protected $settings;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Styles
|
* Styles
|
||||||
*
|
*
|
||||||
@ -179,18 +156,11 @@ class AdminPage
|
|||||||
protected $settings_page;
|
protected $settings_page;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CMB2 custom settings page
|
* Delegate admin_menu hookup to CMB2 implementation
|
||||||
*
|
*
|
||||||
* @var CMB2_OptionsPage|CMB2_OptionsPage_Multi
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
protected $cmb2_page;
|
protected $delegate_hookup = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* Plugin Info Meta Box render object
|
|
||||||
*
|
|
||||||
* @var PluginInfoMetaBox
|
|
||||||
*/
|
|
||||||
protected $plugin_info_meta_box;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@ -208,13 +178,14 @@ class AdminPage
|
|||||||
if ( isset( $options->plugin_core ) )
|
if ( isset( $options->plugin_core ) )
|
||||||
$this->plugin_core( $options->plugin_core );
|
$this->plugin_core( $options->plugin_core );
|
||||||
|
|
||||||
$this->title( $options->title ?? null );
|
if ( isset( $options->title ) )
|
||||||
|
$this->title( $options->title );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo move this to bootstrap()
|
* @todo move this to bootstrap()
|
||||||
*/
|
*/
|
||||||
if ( ! isset( $options->menu_title ) )
|
if ( ! isset( $options->menu_title ) )
|
||||||
$options->menu_title = $this->title;
|
$options->menu_title = $options->title;
|
||||||
|
|
||||||
if ( isset( $options->menu_title ) )
|
if ( isset( $options->menu_title ) )
|
||||||
$this->menu_title( $options->menu_title );
|
$this->menu_title( $options->menu_title );
|
||||||
@ -222,7 +193,8 @@ class AdminPage
|
|||||||
if ( isset( $options->capability ) )
|
if ( isset( $options->capability ) )
|
||||||
$this->capability( $options->capability );
|
$this->capability( $options->capability );
|
||||||
|
|
||||||
$this->slug( $options->slug ?? null );
|
if ( isset( $options->slug ) )
|
||||||
|
$this->slug( $options->slug );
|
||||||
|
|
||||||
if ( isset( $options->plugin_info ) ){ // before render()
|
if ( isset( $options->plugin_info ) ){ // before render()
|
||||||
$this->plugin_info( $options->plugin_info );
|
$this->plugin_info( $options->plugin_info );
|
||||||
@ -232,16 +204,14 @@ class AdminPage
|
|||||||
$this->wrap( $options->wrap );
|
$this->wrap( $options->wrap );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $options->render_cb ) )
|
if ( isset( $options->render ) ) // dev
|
||||||
$this->render_cb( $options->render_cb );
|
|
||||||
|
|
||||||
if ( isset( $options->render_tpl ) ) // before render()
|
|
||||||
$this->render_tpl( $options->render_tpl );
|
|
||||||
|
|
||||||
// This runs last so we can have 'settings-page' with custom render_tpl
|
|
||||||
if ( isset( $options->render ) )
|
|
||||||
$this->render( $options->render );
|
$this->render( $options->render );
|
||||||
|
|
||||||
|
if ( isset( $options->render_cb ) ) // dev - deprecate?
|
||||||
|
$this->render_cb( $options->render_cb );
|
||||||
|
|
||||||
|
if ( isset( $options->render_tpl ) ) // dev - deprecate?
|
||||||
|
$this->render_tpl( $options->render_tpl );
|
||||||
|
|
||||||
if (true)
|
if (true)
|
||||||
$this->render(); // render anyway - will use default tpl if render is empty
|
$this->render(); // render anyway - will use default tpl if render is empty
|
||||||
@ -249,7 +219,6 @@ class AdminPage
|
|||||||
if (true)
|
if (true)
|
||||||
$this->wrap(); // set wrap anyway - will set to 'none' if empty
|
$this->wrap(); // set wrap anyway - will set to 'none' if empty
|
||||||
|
|
||||||
|
|
||||||
if ( isset( $options->parent ) )
|
if ( isset( $options->parent ) )
|
||||||
$this->parent( $options->parent );
|
$this->parent( $options->parent );
|
||||||
|
|
||||||
@ -259,11 +228,6 @@ class AdminPage
|
|||||||
if ( isset( $options->position ) )
|
if ( isset( $options->position ) )
|
||||||
$this->position( $options->position );
|
$this->position( $options->position );
|
||||||
|
|
||||||
if ( isset( $options->tab_group ) ){
|
|
||||||
$this->tab_group( $options->tab_group );
|
|
||||||
$this->tab_title( $options->tab_title ?? $options->submenu_title ?? $options->menu_title );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( isset( $options->scripts ) )
|
if ( isset( $options->scripts ) )
|
||||||
$this->scripts( $options->scripts );
|
$this->scripts( $options->scripts );
|
||||||
|
|
||||||
@ -289,8 +253,8 @@ class AdminPage
|
|||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
private function title( $title=null ) {
|
private function title( $title ) {
|
||||||
$this->title = $title ?? ( isset( $this->plugin_core ) ? $this->plugin_core->title() : __METHOD__ );
|
$this->title = $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -320,19 +284,7 @@ class AdminPage
|
|||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
private function slug( $slug ) {
|
private function slug( $slug ) {
|
||||||
|
$this->slug = $slug;
|
||||||
$this->slug = $slug // if not empty
|
|
||||||
?: $this->settings['option_key'] // if isset option_key
|
|
||||||
?? (
|
|
||||||
isset( $this->plugin_core )
|
|
||||||
? (
|
|
||||||
method_exists( PluginCore::class, 'token' )
|
|
||||||
? $this->plugin_core->token() // PluginCore ~0.25
|
|
||||||
: str_replace('-','_', strtolower( $this->plugin_core->slug() ) ) // PluginCore <= 0.24
|
|
||||||
)
|
|
||||||
: 'slug' . time() // unique slug
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -348,10 +300,6 @@ class AdminPage
|
|||||||
case 'options-general.php':
|
case 'options-general.php':
|
||||||
$this->parent = 'options-general.php';
|
$this->parent = 'options-general.php';
|
||||||
break;
|
break;
|
||||||
case 'tools':
|
|
||||||
case 'tools.php':
|
|
||||||
$this->parent = 'tools.php';
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
$this->parent = $parent;
|
$this->parent = $parent;
|
||||||
break;
|
break;
|
||||||
@ -368,6 +316,7 @@ class AdminPage
|
|||||||
$this->icon_url = $icon_url;
|
$this->icon_url = $icon_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter - position
|
* Setter - position
|
||||||
* WordPress admin menu param
|
* WordPress admin menu param
|
||||||
@ -378,44 +327,6 @@ class AdminPage
|
|||||||
$this->position = $position;
|
$this->position = $position;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Setter - tab_group
|
|
||||||
* CMB2 Tab Group - used by regular 'wrap' pages as well.
|
|
||||||
*
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
private function tab_group( $tab_group ) {
|
|
||||||
$this->tab_group = $tab_group;
|
|
||||||
|
|
||||||
add_filter( 'cmb2_tab_group_tabs', [ $this, 'add_to_tab_group' ], 10, 2 );
|
|
||||||
add_action( 'cmb2_admin_init', function(){
|
|
||||||
/**
|
|
||||||
* When deactivating CMB2 and reactivating - got this fatal error:
|
|
||||||
*
|
|
||||||
* Fatal error: Uncaught Error: Argument 1 passed to CMB2_Options_Hookup::__construct()
|
|
||||||
* must be an instance of CMB2, bool given,
|
|
||||||
* called in \wp-content\plugins\cgv\inc\CGV.php on line 56
|
|
||||||
* in \wp-content\plugins\cmb2\includes\CMB2_Options_Hookup.php on line 39
|
|
||||||
*
|
|
||||||
* Validate cmb2_get_metabox did not return false.
|
|
||||||
*/
|
|
||||||
if ( $cmb = cmb2_get_metabox( $this->parent ) ){
|
|
||||||
$hookup = new CMB2_Options_Hookup( $cmb, $this->slug );
|
|
||||||
add_action ( "wphelper/adminpage/tab_nav/{$this->tab_group}", [ $hookup, 'options_page_tab_nav_output' ] );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Setter - tab_title
|
|
||||||
* CMB2 Tab Title - only set if tab_group.
|
|
||||||
*
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
private function tab_title( $tab_title ) {
|
|
||||||
$this->tab_title = $tab_title;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter - render
|
* Setter - render
|
||||||
* Sets render cb or tpl
|
* Sets render cb or tpl
|
||||||
@ -429,30 +340,34 @@ class AdminPage
|
|||||||
*/
|
*/
|
||||||
private function render( $render=null ) {
|
private function render( $render=null ) {
|
||||||
if ( 'settings-page' == $render ) {
|
if ( 'settings-page' == $render ) {
|
||||||
$this->render_tpl( __DIR__ . '/tpl/form-basic.php' );
|
$this->render_tpl( __DIR__ . '/tpl/settings-form.php' );
|
||||||
$this->render = $this->render ?? $render; // 'settings-page'
|
$this->render = $this->render ?? $render; // 'settings-page'
|
||||||
} else if ( 'cmb2' == $render || 'cmb2-tabs' == $render ) {
|
} else if ( 'cmb2' == $render || 'cmb2-tabs' == $render ) {
|
||||||
|
|
||||||
// validate
|
// validate
|
||||||
if ( ! defined( 'CMB2_LOADED' ) ){
|
if ( ! defined( 'CMB2_LOADED' ) ){
|
||||||
$this->render_tpl( __DIR__ . '/tpl/wrap-cmb2-unavailable.php' );
|
$this->render_tpl( __DIR__ . '/tpl/cmb2-unavailable.php' );
|
||||||
$this->render = $this->render ?? 'render_tpl';
|
$this->render = $this->render ?? 'render_tpl';
|
||||||
} else {
|
} else {
|
||||||
/**
|
$this->delegate_hookup = true;
|
||||||
* Render templates managed and included by CMB2_OptionsPage
|
|
||||||
* @see CMB2_OptionsPage::options_page_output()
|
if ( ! empty( $this->plugin_core ) || ! empty( $this->plugin_info ) ){
|
||||||
*/
|
$this->render_tpl( __DIR__ . '/tpl/cmb2_options_page-plugin_info.php' );
|
||||||
|
} else {
|
||||||
|
$this->render_tpl( __DIR__ . '/tpl/cmb2_options_page.php' );
|
||||||
|
}
|
||||||
|
|
||||||
$this->render = $this->render ?? $render; // 'cmb2' || 'cmb2-tabs'
|
$this->render = $this->render ?? $render; // 'cmb2' || 'cmb2-tabs'
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if( is_callable( $render ) ) {
|
} else if( is_callable( $render ) ) {
|
||||||
$this->render_cb( $render );
|
$this->render_cb( $render );
|
||||||
$this->render = $this->render ?? 'render_cb';
|
$this->render = $this->render ?? 'render_cb';
|
||||||
} else if ( is_readable( $render ?? '' ) ) {
|
} else if ( is_readable( $render ) ) {
|
||||||
$this->render_tpl( $render );
|
$this->render_tpl( $render );
|
||||||
$this->render = $this->render ?? 'render_tpl';
|
$this->render = $this->render ?? 'render_tpl';
|
||||||
} else {
|
} else {
|
||||||
$this->render_tpl( __DIR__ . '/tpl/wrap-default.php' );
|
$this->render_tpl( __DIR__ . '/tpl/default.php' );
|
||||||
$this->render = $this->render ?? 'render_tpl';
|
$this->render = $this->render ?? 'render_tpl';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -550,23 +465,11 @@ class AdminPage
|
|||||||
if( is_callable( $plugin_info ) )
|
if( is_callable( $plugin_info ) )
|
||||||
$this->plugin_info = $plugin_info;
|
$this->plugin_info = $plugin_info;
|
||||||
|
|
||||||
// if true-y value passed and plugin_core isset
|
// if true-y value passed and PluginCore class exists - set to true
|
||||||
else if ( ! empty( $plugin_info ) && ! empty( $this->plugin_core ) )
|
else if (!empty($plugin_info) && class_exists('WPHelper\PluginCore'))
|
||||||
$this->plugin_info = true;
|
$this->plugin_info = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add to tab group
|
|
||||||
*
|
|
||||||
* @hook cmb2_tab_group_tabs
|
|
||||||
*/
|
|
||||||
public function add_to_tab_group( $tabs, $tab_group ){
|
|
||||||
if ( $tab_group == $this->tab_group ){
|
|
||||||
$tabs[ $this->slug ] = $this->tab_title;
|
|
||||||
}
|
|
||||||
return $tabs;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter - scripts
|
* Setter - scripts
|
||||||
* Scripts to enqueue on admin page
|
* Scripts to enqueue on admin page
|
||||||
@ -598,7 +501,7 @@ class AdminPage
|
|||||||
}
|
}
|
||||||
|
|
||||||
function plugin_core($plugin_core){
|
function plugin_core($plugin_core){
|
||||||
if ( $plugin_core instanceof PluginCore ){
|
if ( is_a( $plugin_core, 'WPHelper\PluginCore') ){
|
||||||
$this->plugin_core = $plugin_core;
|
$this->plugin_core = $plugin_core;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -622,18 +525,13 @@ class AdminPage
|
|||||||
'capability' => $this->capability,
|
'capability' => $this->capability,
|
||||||
'slug' => $this->slug,
|
'slug' => $this->slug,
|
||||||
'parent' => $this->parent,
|
'parent' => $this->parent,
|
||||||
'hook_suffix' => $this->hook_suffix,
|
|
||||||
'icon_url' => $this->icon_url,
|
'icon_url' => $this->icon_url,
|
||||||
'position' => $this->position,
|
'position' => $this->position,
|
||||||
'render' => $this->render, // render_cb | render_tpl | settings-page | cmb2 | cmb2-tabs
|
'render' => $this->render, // render_cb | render_tpl | settings-page | cmb2 | cmb2-tabs
|
||||||
'render_cb' => $this->render_cb,
|
'render_cb' => $this->render_cb,
|
||||||
'render_tpl' => $this->render_tpl,
|
'render_tpl' => $this->render_tpl,
|
||||||
'settings' => $this->settings,
|
'settings' => $this->settings,
|
||||||
'wrap' => $this->wrap,
|
|
||||||
'tab_group' => $this->tab_group,
|
|
||||||
'tab_title' => $this->tab_title,
|
|
||||||
'plugin_core' => $this->plugin_core,
|
'plugin_core' => $this->plugin_core,
|
||||||
'plugin_info' => $this->plugin_info,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return $options;
|
return $options;
|
||||||
@ -672,30 +570,37 @@ class AdminPage
|
|||||||
if ( ! $this->capability )
|
if ( ! $this->capability )
|
||||||
$this->capability = 'manage_options';
|
$this->capability = 'manage_options';
|
||||||
|
|
||||||
add_action( "wphelper/adminpage/plugin_info_box/{$this->slug}" , [ $this , 'render_plugin_info_meta_box' ] );
|
if ( $this->render == 'settings-page' ){
|
||||||
|
|
||||||
/**
|
$this->settings_page = new SettingsPage($this);
|
||||||
* @todo Perhaps this can hook on admin_init - right after admin_menu has finished
|
$this->settings_page->setup();
|
||||||
* @todo CMB2 options-page does not return page_hook/hook_suffix - MUST validate
|
|
||||||
*/
|
|
||||||
add_action ( 'admin_init' , [ $this , '_bootstrap_admin_page' ] );
|
|
||||||
|
|
||||||
if ( in_array( $this->render, [ 'cmb2', 'cmb2-tabs' ] ) ){
|
}
|
||||||
|
|
||||||
$this->cmb2_page = $this->settings['options_type'] ?? '' == 'multi'
|
add_action( "wphelper/adminpage/plugin_info_box/{$this->slug}" , [ $this , 'render_plugin_info_box' ] );
|
||||||
? new CMB2_OptionsPage_Multi( $this )
|
|
||||||
: new CMB2_OptionsPage( $this );
|
// if ( $this->delegate_hookup ){
|
||||||
|
if ( 'cmb2' == $this->render || 'cmb2-tabs' == $this->render ){
|
||||||
|
|
||||||
|
if ( isset( $this->settings['options_type'] ) && $this->settings['options_type'] == 'multi' ) {
|
||||||
|
$this->cmb2_page = new CMB2_OptionsPage_Multi( $this );
|
||||||
|
} else {
|
||||||
|
$this->cmb2_page = new CMB2_OptionsPage( $this );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo Perhaps this can hook on admin_init - right after admin_menu has finished
|
||||||
|
* @todo CMB2 options-page does not return page_hook/hook_suffix - MUST validate
|
||||||
|
*/
|
||||||
|
add_action ( 'admin_menu' , [ $this , '_bootstrap_admin_page' ], 12 );
|
||||||
|
|
||||||
// skip add_menu_page
|
// skip add_menu_page
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $this->render == 'settings-page' ){
|
// if ( ! $this->delegate_hookup ){
|
||||||
$this->settings_page = new SettingsPage($this);
|
|
||||||
}
|
|
||||||
|
|
||||||
add_action ( 'admin_menu' , [ $this , 'add_menu_page' ], 11 );
|
add_action ( 'admin_menu' , [ $this , 'add_menu_page' ], 11 );
|
||||||
add_action ( 'admin_menu' , [ $this , 'add_plugin_info_meta_box' ], 11 );
|
add_action ( 'admin_menu' , [ $this , '_bootstrap_admin_page' ], 12 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -739,21 +644,6 @@ class AdminPage
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function add_plugin_info_meta_box() {
|
|
||||||
$metabox_args = [
|
|
||||||
'id' => $this->slug . '_plugin_info_meta_box', // id is unique (in case a plugin uses $this->slug)
|
|
||||||
'title' => 'Plugin Info',
|
|
||||||
'context' => 'side',
|
|
||||||
'screens' => [ $this->get_hook_suffix() ],
|
|
||||||
// 'template',
|
|
||||||
'render' => [ $this , 'render_plugin_info_meta_box_inside' ],
|
|
||||||
];
|
|
||||||
( new MetaBox($metabox_args) )->add();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -763,6 +653,14 @@ class AdminPage
|
|||||||
*/
|
*/
|
||||||
public function validate_page_hook(){
|
public function validate_page_hook(){
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hack!
|
||||||
|
* This is ad hoc validation - should do this earlier
|
||||||
|
*/
|
||||||
|
if ( empty( $this->slug ) ){
|
||||||
|
$this->slug = $this->settings['option_key'];
|
||||||
|
}
|
||||||
|
|
||||||
if ( empty( $this->hook_suffix ) ){
|
if ( empty( $this->hook_suffix ) ){
|
||||||
$this->hook_suffix = get_plugin_page_hookname( $this->slug, $this->parent );
|
$this->hook_suffix = get_plugin_page_hookname( $this->slug, $this->parent );
|
||||||
}
|
}
|
||||||
@ -780,9 +678,14 @@ class AdminPage
|
|||||||
*
|
*
|
||||||
* @hook admin_menu priority 12
|
* @hook admin_menu priority 12
|
||||||
* @access private
|
* @access private
|
||||||
|
*
|
||||||
|
* @todo move this function to admin_init - after admin_menu has finished
|
||||||
*/
|
*/
|
||||||
public function _bootstrap_admin_page(){
|
public function _bootstrap_admin_page(){
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo perhaps run this on 'admin_init'
|
||||||
|
*/
|
||||||
$this->validate_page_hook();
|
$this->validate_page_hook();
|
||||||
|
|
||||||
add_action ( 'load-' . $this->hook_suffix , [ $this , '_admin_page_setup' ] );
|
add_action ( 'load-' . $this->hook_suffix , [ $this , '_admin_page_setup' ] );
|
||||||
@ -951,21 +854,19 @@ class AdminPage
|
|||||||
*/
|
*/
|
||||||
public function render_admin_page()
|
public function render_admin_page()
|
||||||
{
|
{
|
||||||
|
// @todo if render callback supplied - add shortcircuit hook here
|
||||||
|
// execute render callback and return early
|
||||||
|
|
||||||
// if wrap - 1. We collect output buffer
|
|
||||||
if ( 'none' != $this->wrap ){
|
if ( 'none' != $this->wrap ){
|
||||||
ob_start();
|
ob_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------[The McGuffin]---------------------------------//
|
|
||||||
if ( isset( $this->render_cb ) && is_callable( $this->render_cb ) ) {
|
if ( isset( $this->render_cb ) && is_callable( $this->render_cb ) ) {
|
||||||
call_user_func( $this->render_cb );
|
call_user_func( $this->render_cb );
|
||||||
} else if ( isset( $this->render_tpl ) && is_readable( $this->render_tpl ) ) {
|
} else if ( isset( $this->render_tpl ) && is_readable( $this->render_tpl ) ) {
|
||||||
include $this->render_tpl;
|
include $this->render_tpl;
|
||||||
}
|
}
|
||||||
//---------------------------[The McGuffin]---------------------------------//
|
|
||||||
|
|
||||||
// if wrap - 2. include chosen wrap template
|
|
||||||
if ( 'none' != $this->wrap ){
|
if ( 'none' != $this->wrap ){
|
||||||
$ob_content = ob_get_clean();
|
$ob_content = ob_get_clean();
|
||||||
|
|
||||||
@ -984,21 +885,7 @@ class AdminPage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Render plugin info metabox
|
||||||
* @see render_plugin_info_meta_box()
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
public function render_plugin_info_box(){
|
|
||||||
|
|
||||||
_doing_it_wrong( __METHOD__, 'Deprecated. Use render_plugin_info_meta_box() instead.', '0.26' );
|
|
||||||
|
|
||||||
$this->render_plugin_info_meta_box();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Render plugin info meta-box
|
|
||||||
*
|
*
|
||||||
* Call user-provided callable.
|
* Call user-provided callable.
|
||||||
* Or else attempt to create PluginInfoMetaBox class from $this->plugin_core and call its render function.
|
* Or else attempt to create PluginInfoMetaBox class from $this->plugin_core and call its render function.
|
||||||
@ -1008,55 +895,17 @@ class AdminPage
|
|||||||
* @todo See if this function should be public API or only run on action hook
|
* @todo See if this function should be public API or only run on action hook
|
||||||
* @todo deprecate public use - use wphelper/adminpage/plugin_info_box/{$this->slug} instead
|
* @todo deprecate public use - use wphelper/adminpage/plugin_info_box/{$this->slug} instead
|
||||||
*/
|
*/
|
||||||
public function render_plugin_info_meta_box(){
|
public function render_plugin_info_box(){
|
||||||
|
|
||||||
if ( isset( $this->plugin_info ) && is_callable( $this->plugin_info ) ) {
|
if ( isset( $this->plugin_info ) && is_callable( $this->plugin_info ) ) {
|
||||||
call_user_func( $this->plugin_info );
|
call_user_func( $this->plugin_info );
|
||||||
} else {
|
} else {
|
||||||
|
if ( ! empty( $this->plugin_core ) && empty( $this->plugin_info_meta_box ) ){
|
||||||
if (!$this->bootstrap_plugin_info_meta_box()){
|
$this->plugin_info_meta_box = new PluginInfoMetaBox( $this->plugin_core );
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
$this->plugin_info_meta_box->plugin_info_box();
|
||||||
/**
|
|
||||||
* Allow plugins to modify plugin info meta box
|
|
||||||
*
|
|
||||||
* @since 0.23
|
|
||||||
*/
|
|
||||||
do_action( "wphelper/plugin_info_meta_box/{$this->plugin_core->slug()}" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function render_plugin_info_meta_box_inside(){
|
|
||||||
if ( isset( $this->plugin_info ) && is_callable( $this->plugin_info ) ) {
|
|
||||||
call_user_func( $this->plugin_info );
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (!$this->bootstrap_plugin_info_meta_box()){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
do_action( "wphelper/plugin_info_meta_box/inside/{$this->plugin_core->slug()}" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap PluginInfoMetaBox
|
|
||||||
*/
|
|
||||||
private function bootstrap_plugin_info_meta_box() {
|
|
||||||
if ( empty( $this->plugin_info_meta_box ) && ! empty( $this->plugin_core ) ){
|
|
||||||
$this->plugin_info_meta_box = new PluginInfoMetaBox( $this->plugin_core );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no plugin_info_meta_box - return false
|
|
||||||
if ( empty( $this->plugin_info_meta_box ) ) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
@ -4,9 +4,9 @@ namespace WPHelper;
|
|||||||
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
||||||
|
|
||||||
use CMB2;
|
use CMB2;
|
||||||
use CMB2_Options_Hookup;
|
use CMB2_Options_Hook;
|
||||||
|
|
||||||
if ( ! class_exists( CMB2_OptionsPage::class ) ):
|
if ( ! class_exists( 'WPHelper\CMB2_OptionsPage' ) ):
|
||||||
/**
|
/**
|
||||||
* CMB2_OptionsPage
|
* CMB2_OptionsPage
|
||||||
*
|
*
|
||||||
@ -26,21 +26,11 @@ class CMB2_OptionsPage{
|
|||||||
*/
|
*/
|
||||||
public $admin_page;
|
public $admin_page;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array $fields
|
|
||||||
*/
|
|
||||||
protected $fields;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var CMB2 $cmb
|
* @var CMB2 $cmb
|
||||||
*/
|
*/
|
||||||
private $cmb;
|
private $cmb;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array $cmb2_options
|
|
||||||
*/
|
|
||||||
protected $cmb2_options;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param AdminPage $admin_page
|
* @param AdminPage $admin_page
|
||||||
*/
|
*/
|
||||||
@ -58,8 +48,6 @@ class CMB2_OptionsPage{
|
|||||||
$settings['option_key'] ??= ( $settings['option_name'] ?? ( $settings['id'] ?? $admin_options['slug'] ) );
|
$settings['option_key'] ??= ( $settings['option_name'] ?? ( $settings['id'] ?? $admin_options['slug'] ) );
|
||||||
$settings['title'] ??= $admin_options['title'];
|
$settings['title'] ??= $admin_options['title'];
|
||||||
$settings['menu_title'] ??= $admin_options['menu_title'];
|
$settings['menu_title'] ??= $admin_options['menu_title'];
|
||||||
// @todo Only if cmb2-tabs
|
|
||||||
$settings['tab_title'] ??= $admin_options['tab_title'] ?? $settings['submenu_title'] ?? $settings['menu_title'];
|
|
||||||
$settings['parent_slug'] ??= $admin_options['parent'];
|
$settings['parent_slug'] ??= $admin_options['parent'];
|
||||||
$settings['position'] ??= $admin_options['position'];
|
$settings['position'] ??= $admin_options['position'];
|
||||||
$settings['icon_url'] ??= $admin_options['icon_url'];
|
$settings['icon_url'] ??= $admin_options['icon_url'];
|
||||||
@ -75,8 +63,7 @@ class CMB2_OptionsPage{
|
|||||||
/**
|
/**
|
||||||
* CMB2 only accepts url slug
|
* CMB2 only accepts url slug
|
||||||
*
|
*
|
||||||
* @todo export parent_slug conversion to dedicated method
|
* @todo export parent_slug convertion to dedicated method
|
||||||
* @todo perhaps move this to AdminPage::parent() method
|
|
||||||
*/
|
*/
|
||||||
switch ( $settings['parent_slug'] ) {
|
switch ( $settings['parent_slug'] ) {
|
||||||
case 'dashboard':
|
case 'dashboard':
|
||||||
@ -129,11 +116,11 @@ class CMB2_OptionsPage{
|
|||||||
$settings['tab_title'] ??= $settings['menu_title'];
|
$settings['tab_title'] ??= $settings['menu_title'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->fields = $settings['fields'] ?? [];
|
|
||||||
/**
|
|
||||||
* @todo revisit this - might not need to unset fields
|
|
||||||
*/
|
|
||||||
if ( isset( $settings['fields'] ) ){
|
if ( isset( $settings['fields'] ) ){
|
||||||
|
$this->fields = $settings['fields'];
|
||||||
|
/**
|
||||||
|
* @todo revisit this - might not need to unset fields
|
||||||
|
*/
|
||||||
unset( $settings['fields'] );
|
unset( $settings['fields'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,11 +179,7 @@ class CMB2_OptionsPage{
|
|||||||
// register parent pages before sub-menu pages
|
// register parent pages before sub-menu pages
|
||||||
$priority = empty( $settings['parent_slug'] ) ? 9 : 10;
|
$priority = empty( $settings['parent_slug'] ) ? 9 : 10;
|
||||||
|
|
||||||
if ( $settings['allow_on_front'] ?? false ){
|
add_action( 'cmb2_admin_init', [ $this, 'register_metabox' ], $priority );
|
||||||
add_action( 'cmb2_init', [ $this, 'register_metabox' ], $priority );
|
|
||||||
} else {
|
|
||||||
add_action( 'cmb2_admin_init', [ $this, 'register_metabox' ], $priority );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo add 'submenu' field and functionality to WPHelper\AdminPage
|
* @todo add 'submenu' field and functionality to WPHelper\AdminPage
|
||||||
@ -215,20 +198,12 @@ class CMB2_OptionsPage{
|
|||||||
/**
|
/**
|
||||||
* Display options-page output. To override, set 'display_cb' box property.
|
* Display options-page output. To override, set 'display_cb' box property.
|
||||||
*
|
*
|
||||||
* @param CMB2_Options_Hookup $hookup - instance of Options Page Hookup class (caller of this function)
|
* @param CMB2_Options_Hook $hookup - instance of Options Page Hookup class (caller of this function)
|
||||||
*
|
*
|
||||||
* @see CMB2_Options_Hookup
|
* @see CMB2_Options_Hook
|
||||||
*/
|
*/
|
||||||
public function options_page_output( $hookup ) {
|
public function options_page_output( $hookup ) {
|
||||||
|
include $this->admin_page->get_render_tpl();
|
||||||
$options = $this->admin_page->options();
|
|
||||||
|
|
||||||
if ( ! empty( $options['plugin_core'] ) || ! empty( $options['plugin_info'] ) ){
|
|
||||||
include __DIR__ . '/tpl/wrap-cmb2-sidebar.php';
|
|
||||||
} else {
|
|
||||||
include __DIR__ . '/tpl/wrap-cmb2-simple.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,13 +3,9 @@ namespace WPHelper;
|
|||||||
|
|
||||||
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
||||||
|
|
||||||
if ( ! class_exists( CMB2_OptionsPage_Multi::class ) ):
|
include_once __DIR__ . '/CMB2_Override_Meta.php';
|
||||||
|
|
||||||
// Require dependency CMB2_Override_Meta
|
|
||||||
if ( ! trait_exists( CMB2_Override_Meta::class ) ) {
|
|
||||||
require_once __DIR__ . '/CMB2_Override_Meta.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if ( ! class_exists( 'WPHelper\CMB2_OptionsPage_Multi' ) ):
|
||||||
/**
|
/**
|
||||||
* CMB2_OptionsPage - MULTI
|
* CMB2_OptionsPage - MULTI
|
||||||
*
|
*
|
||||||
|
|||||||
@ -3,7 +3,7 @@ namespace WPHelper;
|
|||||||
|
|
||||||
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
||||||
|
|
||||||
if ( ! trait_exists( CMB2_Override_Meta::class ) ):
|
if ( ! trait_exists('CMB2_Override_Meta') ):
|
||||||
/**
|
/**
|
||||||
* CMB2 Options page override meta
|
* CMB2 Options page override meta
|
||||||
*
|
*
|
||||||
|
|||||||
@ -2,75 +2,27 @@
|
|||||||
namespace WPHelper;
|
namespace WPHelper;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
use function get_plugin_data;
|
||||||
|
|
||||||
if ( ! class_exists( PluginInfoMetaBox::class ) ):
|
if ( ! class_exists( 'WPHelper\PluginInfoMetaBox' ) ):
|
||||||
/**
|
/**
|
||||||
* Plugin Info Metabox
|
* Plugin Info Metabox
|
||||||
*
|
*
|
||||||
* Get instance of PluginCore
|
* Get instance of PluginCore
|
||||||
* Render default plugin info box template.
|
* Render default plugin info box template.
|
||||||
*
|
|
||||||
* @since 0.14
|
|
||||||
*/
|
*/
|
||||||
class PluginInfoMetaBox{
|
class PluginInfoMetaBox{
|
||||||
|
|
||||||
private $tpl = '/tpl/plugin_info_meta_box.php';
|
private $tpl = '/tpl/plugin_info_meta_box.php';
|
||||||
|
|
||||||
private $tpl_inside = '/tpl/plugin_info_meta_box-inside.php';
|
|
||||||
|
|
||||||
private $tpl_debug = '/tpl/plugin_info_meta_box-wph_debug.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var PluginCore
|
* @var PluginCore
|
||||||
*/
|
*/
|
||||||
public $plugin_core;
|
private $plugin_core;
|
||||||
|
|
||||||
function __construct( PluginCore $plugin_core )
|
function __construct( PluginCore $plugin_core )
|
||||||
{
|
{
|
||||||
$this->plugin_core = $plugin_core;
|
$this->plugin_core = $plugin_core;
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow plugins to render or modify plugin info box
|
|
||||||
*
|
|
||||||
* Call: do_action('wphelper/plugin_info_meta_box/{$slug}')
|
|
||||||
* action used in AdminPage::render_plugin_info_meta_box()
|
|
||||||
*
|
|
||||||
* @since 0.23
|
|
||||||
*/
|
|
||||||
add_action( "wphelper/plugin_info_meta_box/{$this->plugin_core->slug()}", [ $this, 'plugin_info_box' ] );
|
|
||||||
|
|
||||||
add_action( "wphelper/plugin_info_meta_box/inside/{$this->plugin_core->slug()}", [ $this, 'inside' ] );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Setup args used in template.
|
|
||||||
*
|
|
||||||
* @todo move 'repo' setup to method from template
|
|
||||||
*/
|
|
||||||
function setup_template_args() {
|
|
||||||
|
|
||||||
$plugin_data = $this->plugin_core->plugin_data();
|
|
||||||
|
|
||||||
|
|
||||||
$last_update = $plugin_data['Last Update'] ?: $plugin_data['Release Date'];
|
|
||||||
$last_update = DateTime::createFromFormat('Y_m_d', $last_update);
|
|
||||||
|
|
||||||
if ($last_update) {
|
|
||||||
$diff = (int) abs( time() - $last_update->format('U') );
|
|
||||||
|
|
||||||
if ( $diff < (DAY_IN_SECONDS) ){
|
|
||||||
$update_message = 'Today';
|
|
||||||
}elseif ($diff < (2 * DAY_IN_SECONDS)){
|
|
||||||
$update_message = 'Yesterday';
|
|
||||||
}else{
|
|
||||||
$update_message = human_time_diff($last_update->format('U')) . ' ago';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$update_message = '';
|
|
||||||
}
|
|
||||||
return compact('plugin_data','update_message');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,36 +33,33 @@ class PluginInfoMetaBox{
|
|||||||
* @since iac_engine 1.1.0
|
* @since iac_engine 1.1.0
|
||||||
* @since iac_engine 1.2.0 plugin_info_box now a function
|
* @since iac_engine 1.2.0 plugin_info_box now a function
|
||||||
* @since iac_engine 1.3.0 use 'Last Update' header
|
* @since iac_engine 1.3.0 use 'Last Update' header
|
||||||
* @since 0.14 PluginInfoMetaBox::plugin_info_box()
|
|
||||||
*
|
|
||||||
* @todo rename method render()
|
|
||||||
*/
|
*/
|
||||||
function plugin_info_box(){
|
function plugin_info_box(){
|
||||||
$args = $this->setup_template_args();
|
|
||||||
extract($args);
|
$plugin_data = get_plugin_data( $this->plugin_core->file() , false ); // false = no markup (i think)
|
||||||
|
|
||||||
|
|
||||||
|
$last_update = $plugin_data['Last Update'] ?: $plugin_data['Release Date'];
|
||||||
|
$last_update = DateTime::createFromFormat('Y_m_d', $last_update);
|
||||||
|
|
||||||
|
// $last_update = new DateTime('now');
|
||||||
|
// $last_update->add(new DateInterval('P1D'));
|
||||||
|
// $last_update->add(new DateInterval('P2D'));
|
||||||
|
if ($last_update):
|
||||||
|
$diff = (int) abs( time() - $last_update->format('U') );
|
||||||
|
|
||||||
|
if ( $diff < (DAY_IN_SECONDS) ){
|
||||||
|
$update_message = 'Today';
|
||||||
|
}elseif ($diff < (2 * DAY_IN_SECONDS)){
|
||||||
|
$update_message = 'Yesterday';
|
||||||
|
}else{
|
||||||
|
$update_message = human_time_diff($last_update->format('U')) . ' ago';
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
$update_message = '';
|
||||||
|
endif;
|
||||||
|
|
||||||
include __DIR__ . $this->tpl;
|
include __DIR__ . $this->tpl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Only print meta-box .inside
|
|
||||||
* No header.
|
|
||||||
*/
|
|
||||||
function inside(){
|
|
||||||
$args = $this->setup_template_args();
|
|
||||||
extract($args);
|
|
||||||
include __DIR__ . $this->tpl_inside;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WPHelper classes debug info
|
|
||||||
*
|
|
||||||
* Prints inside Plugin Info Meta Box
|
|
||||||
*
|
|
||||||
* @since 0.26
|
|
||||||
*/
|
|
||||||
function wph_debug() {
|
|
||||||
include __DIR__ . $this->tpl_debug;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
108
vendor/abuyoyo/adminmenupage/src/SettingsPage.php
vendored
108
vendor/abuyoyo/adminmenupage/src/SettingsPage.php
vendored
@ -9,7 +9,7 @@ use function add_settings_field;
|
|||||||
use function checked;
|
use function checked;
|
||||||
use function get_option;
|
use function get_option;
|
||||||
|
|
||||||
if ( ! class_exists( SettingsPage::class ) ):
|
if ( ! class_exists( 'WPHelper\SettingsPage' ) ):
|
||||||
/**
|
/**
|
||||||
* SettingsPage
|
* SettingsPage
|
||||||
*
|
*
|
||||||
@ -32,45 +32,38 @@ class SettingsPage{
|
|||||||
/**
|
/**
|
||||||
* Page slug to display sections
|
* Page slug to display sections
|
||||||
*
|
*
|
||||||
* @var string $page
|
* @var String $page
|
||||||
*/
|
*/
|
||||||
public $page;
|
protected $page;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* option_name key used in wp_options table
|
* option_name key used in wp_options table
|
||||||
*
|
*
|
||||||
* @var string $option_name
|
* @var String $option_name
|
||||||
*/
|
*/
|
||||||
protected $option_name;
|
protected $option_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* option_group used by register_setting() and settings_fields()
|
* option_group used by register_setting() and settings_fields()
|
||||||
*
|
*
|
||||||
* @var string $option_group
|
* @var String $option_group
|
||||||
*/
|
*/
|
||||||
public $option_group;
|
public $option_group;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sections
|
* Sections
|
||||||
*
|
*
|
||||||
* @var array[] $sections
|
* @var Array[] $sections
|
||||||
*/
|
*/
|
||||||
public $sections = [];
|
public $sections = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fields
|
* Fields
|
||||||
*
|
*
|
||||||
* @var array[] $fields
|
* @var Array[] $fields
|
||||||
*/
|
*/
|
||||||
public $fields = [];
|
public $fields = [];
|
||||||
|
|
||||||
/**
|
|
||||||
* Sanitize Callback
|
|
||||||
*
|
|
||||||
* @var Callable $sanitize_callback
|
|
||||||
*/
|
|
||||||
public $sanitize_callback;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
@ -96,20 +89,18 @@ class SettingsPage{
|
|||||||
|
|
||||||
$this->option_group = $settings['option_group'] ?? $this->page . '_option_group';
|
$this->option_group = $settings['option_group'] ?? $this->page . '_option_group';
|
||||||
|
|
||||||
$this->sanitize_callback = $settings['sanitize_callback'] ?? null;
|
foreach ( $settings['sections'] as $section ) {
|
||||||
|
|
||||||
// PHP Warning: foreach() argument must be of type array|object
|
|
||||||
foreach ( $settings['sections'] ?? [] as $section ) {
|
|
||||||
// extract fields
|
// extract fields
|
||||||
foreach ( $section['fields'] as $field ){
|
foreach ( $section['fields'] as $field ){
|
||||||
$field['section_id'] = $section['id']; // create back-reference in field to section. ( @see add_settings_field() )
|
$field['section_id'] = $section['id']; // create back-reference in field to section. ( @see add_settings_field() )
|
||||||
$field['name'] = $this->option_name . '[' . $field['id'] . ']';
|
|
||||||
$this->fields[] = $field;
|
$this->fields[] = $field;
|
||||||
}
|
}
|
||||||
unset( $section['fields'] );
|
unset( $section['fields'] );
|
||||||
$this->sections[] = $section; // save without fields
|
$this->sections[] = $section; // save without fields
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setup() {
|
||||||
add_action( 'admin_init', [ $this, 'register_settings' ] );
|
add_action( 'admin_init', [ $this, 'register_settings' ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +108,7 @@ class SettingsPage{
|
|||||||
register_setting(
|
register_setting(
|
||||||
$this->option_group, // $option_group - A settings group name. Must exist prior to the register_setting call. This must match the group name in settings_fields()
|
$this->option_group, // $option_group - A settings group name. Must exist prior to the register_setting call. This must match the group name in settings_fields()
|
||||||
$this->option_name, // $option_name - The name of an option to sanitize and save.
|
$this->option_name, // $option_name - The name of an option to sanitize and save.
|
||||||
$this->sanitize_callback ?? [ $this,'sanitize_settings' ] // callback ?? fallback // $sanitize_callback - A callback function that sanitizes the option's value. (see also: built-in php callbacks)
|
[ $this,'sanitize_settings' ] // $sanitize_callback - A callback function that sanitizes the option's value. (see also: built-in php callbacks)
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ( $this->sections as $section ){
|
foreach ( $this->sections as $section ){
|
||||||
@ -134,7 +125,7 @@ class SettingsPage{
|
|||||||
add_settings_field(
|
add_settings_field(
|
||||||
$field['id'],
|
$field['id'],
|
||||||
$field['title'],
|
$field['title'],
|
||||||
$field['render'] ?? [ $this, "print_{$field['type']}" ],
|
[ $this, "print_{$field['type']}" ],
|
||||||
$this->page, // can built-in pages: (general, reading, writing, ...)
|
$this->page, // can built-in pages: (general, reading, writing, ...)
|
||||||
$field['section_id'],
|
$field['section_id'],
|
||||||
$field //send setting array as $args for print function
|
$field //send setting array as $args for print function
|
||||||
@ -144,8 +135,8 @@ class SettingsPage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print checkbox input field
|
* Print text input field
|
||||||
* Support field type 'checkbox'
|
* Support field type 'text'
|
||||||
*
|
*
|
||||||
* @since 0.11
|
* @since 0.11
|
||||||
*/
|
*/
|
||||||
@ -156,11 +147,10 @@ class SettingsPage{
|
|||||||
|
|
||||||
$input_tag = sprintf(
|
$input_tag = sprintf(
|
||||||
'<label for="%1$s">
|
'<label for="%1$s">
|
||||||
<input name="%2$s" type="checkbox" id="%1$s" aria-describedby="%1$s-description" value="1" %4$s />
|
<input name="%2$s[%1$s]" type="checkbox" id="%1$s" value="1" %4$s />
|
||||||
%3$s
|
%3$s</label>',
|
||||||
</label>',
|
|
||||||
$id,
|
$id,
|
||||||
$name,
|
$this->option_name,
|
||||||
$description,
|
$description,
|
||||||
checked( ( $options[$id] ?? false ), '1', false)
|
checked( ( $options[$id] ?? false ), '1', false)
|
||||||
);
|
);
|
||||||
@ -186,11 +176,10 @@ class SettingsPage{
|
|||||||
$options = get_option( $this->option_name );
|
$options = get_option( $this->option_name );
|
||||||
|
|
||||||
$input_tag = sprintf(
|
$input_tag = sprintf(
|
||||||
'<input name="%2$s" type="text" id="%1$s" aria-describedby="%1$s-description" value="%3$s" placeholder="%4$s" class="regular-text">',
|
'<input name="%2$s[%1$s]" type="text" id="%1$s" value="%3$s" class="regular-text">',
|
||||||
$id,
|
$id,
|
||||||
$name,
|
$this->option_name,
|
||||||
$options[$id] ?: $default ?? '',
|
$default
|
||||||
$placeholder ?? ''
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( ! empty( $description ) ) {
|
if ( ! empty( $description ) ) {
|
||||||
@ -222,11 +211,10 @@ class SettingsPage{
|
|||||||
$options = get_option( $this->option_name );
|
$options = get_option( $this->option_name );
|
||||||
|
|
||||||
$input_tag = sprintf(
|
$input_tag = sprintf(
|
||||||
'<input name="%2$s" type="url" id="%1$s" aria-describedby="%1$s-description" placeholder="%4$s" value="%3$s" class="regular-text code ">',
|
'<input name="%2$s[%1$s]" type="url" id="%1$s" value="%3$s" class="regular-text code ">',
|
||||||
$id,
|
$id,
|
||||||
$name,
|
$this->option_name,
|
||||||
$options[$id] ?: $default ?? '',
|
$default
|
||||||
$placeholder ?? ''
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( ! empty( $description ) ) {
|
if ( ! empty( $description ) ) {
|
||||||
@ -258,11 +246,10 @@ class SettingsPage{
|
|||||||
$options = get_option( $this->option_name );
|
$options = get_option( $this->option_name );
|
||||||
|
|
||||||
$input_tag = sprintf(
|
$input_tag = sprintf(
|
||||||
'<input name="%2$s" type="email" id="%1$s" aria-describedby="%1$s-description" placeholder="%4$s" value="%3$s" class="regular-text ltr">',
|
'<input name="%2$s[%1$s]" type="email" id="%1$s" aria-describedby="%1$s-description" value="%3$s" class="regular-text ltr">',
|
||||||
$id,
|
$id,
|
||||||
$name,
|
$this->option_name,
|
||||||
$options[$id] ?: $default ?? '',
|
$default
|
||||||
$placeholder ?? ''
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( ! empty( $description ) ) {
|
if ( ! empty( $description ) ) {
|
||||||
@ -282,42 +269,6 @@ class SettingsPage{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Print email input field
|
|
||||||
* Support field type 'email'
|
|
||||||
*
|
|
||||||
* @since 0.23
|
|
||||||
*/
|
|
||||||
function print_textarea( $field ){
|
|
||||||
extract($field);
|
|
||||||
|
|
||||||
$options = get_option( $this->option_name );
|
|
||||||
|
|
||||||
$textarea = sprintf(
|
|
||||||
'<textarea class="regular-text" rows="5" id="%1$s-description" name="%2$s" placeholder="%4$s">%3$s</textarea>',
|
|
||||||
$id,
|
|
||||||
$name,
|
|
||||||
$options[$id] ?: $default ?? '',
|
|
||||||
$placeholder ?? ''
|
|
||||||
);
|
|
||||||
|
|
||||||
if ( ! empty( $description ) ) {
|
|
||||||
$textarea .= sprintf(
|
|
||||||
'<p class="description" id="%1$s-description">%2$s</p>',
|
|
||||||
$id,
|
|
||||||
$description
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow plugins to directly manipulate field HTML
|
|
||||||
*/
|
|
||||||
$textarea = apply_filters( 'wphelper/settings_page/textarea', $textarea, $field, $this->option_name, $options );
|
|
||||||
|
|
||||||
echo $textarea;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sanitizes entire $options array.
|
* Sanitizes entire $options array.
|
||||||
*/
|
*/
|
||||||
@ -325,25 +276,24 @@ class SettingsPage{
|
|||||||
$new_options = [];
|
$new_options = [];
|
||||||
|
|
||||||
foreach( $options as $id => $option ) {
|
foreach( $options as $id => $option ) {
|
||||||
$field = current(
|
$field = reset(
|
||||||
array_filter(
|
array_filter(
|
||||||
$this->fields,
|
$this->fields,
|
||||||
fn($item) => $item['id'] == $id
|
fn($item) => $item['id'] == $id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
switch ( $field['type'] ) {
|
switch ( $field['type'] ){
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
$new_options[$id] = $option == 1 ? 1 : 0;
|
$new_options[$id] = $option == 1 ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'textarea':
|
|
||||||
$new_options[$id] = sanitize_text_field( $option );
|
$new_options[$id] = sanitize_text_field( $option );
|
||||||
break;
|
break;
|
||||||
case 'email':
|
case 'email':
|
||||||
$new_options[$id] = sanitize_email( $option );
|
$new_options[$id] = sanitize_email( $option );
|
||||||
break;
|
break;
|
||||||
case 'url':
|
case 'url':
|
||||||
$new_options[$id] = esc_url_raw( $option );
|
$new_options[$id] = sanitize_url( $option );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Template for CMB2 page title
|
* Template for CMB2 page title
|
||||||
*
|
*
|
||||||
* @var WPHelper\CMB2_OptionsPage $this
|
* @var WPHelper\CMB2_Options_Page $this
|
||||||
*/
|
*/
|
||||||
if ( $this->cmb->prop( 'title' ) ) {
|
if ( $this->cmb->prop( 'title' ) ) {
|
||||||
echo '<h2>' . wp_kses_post( $this->cmb->prop( 'title' ) ) . '</h2>';
|
echo '<h2>' . wp_kses_post( $this->cmb->prop( 'title' ) ) . '</h2>';
|
||||||
@ -4,6 +4,6 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<h3>CMB2 Plugin Missing</h3>
|
<h3>CMB2 Plugin Missing</h3>
|
||||||
<p>CMB2 plugin is required to display this page.
|
<p>CMB2 plugin is required to display this page.
|
||||||
<br>Please install and activate <a href="<?php echo admin_url('plugin-install.php?s=cmb2&tab=search') ?>">CMB2 plugin</a>.
|
<br>Download and activate CMB2 plugin.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -2,8 +2,8 @@
|
|||||||
/**
|
/**
|
||||||
* Template for CMB2 Options Page
|
* Template for CMB2 Options Page
|
||||||
*
|
*
|
||||||
* @var WPHelper\CMB2_OptionsPage $this
|
* @var WPHelper\CMB2_Options_Page $this
|
||||||
* @var CMB2_Options_Hookup $hookup
|
* @var CMB2_Options_Hook $hookup
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
@ -17,8 +17,8 @@
|
|||||||
</style>
|
</style>
|
||||||
<div class="wrap cmb2-options-page option-<?php echo esc_attr( sanitize_html_class( $hookup->option_key ) ); ?>">
|
<div class="wrap cmb2-options-page option-<?php echo esc_attr( sanitize_html_class( $hookup->option_key ) ); ?>">
|
||||||
|
|
||||||
<?php include 'title-cmb2.php' ?>
|
<?php include 'cmb-title.php' ?>
|
||||||
<?php include 'tab-nav-cmb2.php' ?>
|
<?php include 'tab-nav.php' ?>
|
||||||
|
|
||||||
<div id="poststuff">
|
<div id="poststuff">
|
||||||
<div id="post-body" class="metabox-holder columns-2">
|
<div id="post-body" class="metabox-holder columns-2">
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<!-- main content -->
|
<!-- main content -->
|
||||||
<div id="post-body-content">
|
<div id="post-body-content">
|
||||||
<div class="meta-box-sortables ui-sortable tabs-content">
|
<div class="meta-box-sortables ui-sortable tabs-content">
|
||||||
<?php include 'form-cmb2.php' ?>
|
<?php include 'cmb-form.php' ?>
|
||||||
</div><!-- .meta-box-sortables -->
|
</div><!-- .meta-box-sortables -->
|
||||||
</div><!-- #post-body-content -->
|
</div><!-- #post-body-content -->
|
||||||
|
|
||||||
13
vendor/abuyoyo/adminmenupage/src/tpl/cmb2_options_page.php
vendored
Normal file
13
vendor/abuyoyo/adminmenupage/src/tpl/cmb2_options_page.php
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Template for CMB2 Options Page
|
||||||
|
*
|
||||||
|
* @var WPHelper\CMB2_Options_Page $this
|
||||||
|
* @var CMB2_Options_Hook $hookup
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<div class="wrap cmb2-options-page option-<?php echo esc_attr( sanitize_html_class( $hookup->option_key ) ); ?>">
|
||||||
|
<?php include 'cmb-title.php' ?>
|
||||||
|
<?php include 'tab-nav.php' ?>
|
||||||
|
<?php include 'cmb-form.php' ?>
|
||||||
|
</div>
|
||||||
@ -1,10 +1,3 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* WordPress admin 'wrap' div
|
|
||||||
*
|
|
||||||
* @var WPHelper\AdminPage $this
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h1><?= get_admin_page_title() ?></h1>
|
<h1><?= get_admin_page_title() ?></h1>
|
||||||
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Plugin Info Metabox - .inside
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
<h3 style="font-weight: 100; font-size: 1.5em;"><?php echo $plugin_data['Name']; ?></h3>
|
|
||||||
<p>
|
|
||||||
<?php if ( ! empty( $plugin_data['Version'] ) ): ?>
|
|
||||||
Version: <?php echo $plugin_data['Version']; ?><br/>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ( ! empty( $plugin_data['Author'] ) ): ?>
|
|
||||||
Author:
|
|
||||||
<?php if ( ! empty( $plugin_data['AuthorURI'] ) ): ?>
|
|
||||||
<a href="<?php echo $plugin_data['AuthorURI'] ?>"><?php echo $plugin_data['Author']; ?></a><br/>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php echo $plugin_data['Author']; ?><br/>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ( ! empty( $plugin_data['UpdateURI'] ) || ! empty( $plugin_data['PluginURI'] ) ): ?>
|
|
||||||
Repo: <a href="<?php echo $plugin_data['UpdateURI'] ?: $plugin_data['PluginURI']; ?>">
|
|
||||||
<?php echo $plugin_data['TextDomain'] ?? $this->$plugin_core->slug(); ?>
|
|
||||||
</a><br/>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ( ! empty( $update_message ) ): ?>
|
|
||||||
Last Updated: <?php echo $update_message; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</p>
|
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Print WPHelper debug info in plugin info meta box
|
|
||||||
*
|
|
||||||
* @since 0.26
|
|
||||||
*/
|
|
||||||
if ( defined('WPH_DEBUG') && WPH_DEBUG ) {
|
|
||||||
/** @var WPHelper\PluginInfoMetaBox $this */
|
|
||||||
$this->wph_debug();
|
|
||||||
}
|
|
||||||
@ -1,84 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Plugin Info Metabox - .wph-debug
|
|
||||||
*
|
|
||||||
* @since 0.26
|
|
||||||
*/
|
|
||||||
|
|
||||||
use WPHelper\AdminPage;
|
|
||||||
use WPHelper\MetaBox;
|
|
||||||
use WPHelper\PluginCore;
|
|
||||||
use WPHelper\Utility\Singleton;
|
|
||||||
use WPHelper\DatabaseTable;
|
|
||||||
|
|
||||||
if (class_exists(AdminPage::class)){
|
|
||||||
$wph_admin_ref = new ReflectionClass(AdminPage::class);
|
|
||||||
$wph_admin_file = $wph_admin_ref->getFileName();
|
|
||||||
$wph_admin_composer = json_decode(file_get_contents( dirname( dirname( $wph_admin_file ) ) . '/composer.json' )) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (class_exists(PluginCore::class)){
|
|
||||||
$wph_pc_ref = new ReflectionClass(PluginCore::class);
|
|
||||||
$wph_pc_file = $wph_pc_ref->getFileName();
|
|
||||||
$wph_pc_composer = json_decode(file_get_contents( dirname( $wph_pc_file ) . '/composer.json' )) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (class_exists(MetaBox::class)){
|
|
||||||
$wph_mb_ref = new ReflectionClass(MetaBox::class);
|
|
||||||
$wph_mb_file = $wph_mb_ref->getFileName();
|
|
||||||
$wph_mb_composer = json_decode(file_get_contents( dirname( $wph_mb_file ) . '/composer.json' )) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (trait_exists(Singleton::class)){
|
|
||||||
$wph_util_ref = new ReflectionClass(Singleton::class);
|
|
||||||
$wph_util_file = $wph_util_ref->getFileName();
|
|
||||||
$wph_util_composer = json_decode(file_get_contents( dirname( dirname( $wph_util_file ) ) . '/composer.json' )) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (class_exists(DatabaseTable::class)){
|
|
||||||
$wph_db_ref = new ReflectionClass(DatabaseTable::class);
|
|
||||||
$wph_db_file = $wph_db_ref->getFileName();
|
|
||||||
$wph_db_composer = json_decode(file_get_contents( dirname( $wph_db_file ) . '/composer.json' )) ;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<style>
|
|
||||||
.inside {
|
|
||||||
word-wrap: break-word;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<?php if ( ! empty( $wph_admin_composer ) ): ?>
|
|
||||||
<hr>
|
|
||||||
<p>
|
|
||||||
AdminPage: <?php echo $wph_admin_composer->version; ?><br/>
|
|
||||||
Location: <?php echo $wph_admin_file; ?><br/>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ( ! empty( $wph_pc_composer ) ): ?>
|
|
||||||
<hr>
|
|
||||||
<p>
|
|
||||||
PluginCore: <?php echo $wph_pc_composer->version; ?><br/>
|
|
||||||
Location: <?php echo $wph_pc_file; ?><br/>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ( ! empty( $wph_mb_composer ) ): ?>
|
|
||||||
<hr>
|
|
||||||
<p>
|
|
||||||
MetaBox: <?php echo $wph_mb_composer->version; ?><br/>
|
|
||||||
Location: <?php echo $wph_mb_file; ?><br/>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ( ! empty( $wph_util_composer ) ): ?>
|
|
||||||
<hr>
|
|
||||||
<p>
|
|
||||||
Utility: <?php echo $wph_util_composer->version; ?><br/>
|
|
||||||
Location: <?php echo $wph_util_file; ?><br/>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ( ! empty( $wph_db_composer ) ): ?>
|
|
||||||
<hr>
|
|
||||||
<p>
|
|
||||||
DatabaseTable: <?php echo $wph_db_composer->version; ?><br/>
|
|
||||||
Location: <?php echo $wph_db_file; ?><br/>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
@ -3,10 +3,25 @@
|
|||||||
* Plugin Info Metabox
|
* Plugin Info Metabox
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
<style>
|
||||||
|
#plugin_info h2 {
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
#plugin_info h3{
|
||||||
|
font-weight: 100;
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div id="plugin_info" class="postbox">
|
<div id="plugin_info" class="postbox">
|
||||||
<h2 style="border-bottom: 1px solid #eee;"><span>Plugin Info</span></h2>
|
<h2><span>Plugin Info</span></h2>
|
||||||
<div class="inside">
|
<div class="inside">
|
||||||
<?php include __DIR__ . '/plugin_info_meta_box-inside.php'; ?>
|
<h3><?=$plugin_data['Name'] ?></h3>
|
||||||
|
<p>
|
||||||
|
Version: <?= $plugin_data['Version'] ?><br/>
|
||||||
|
Author: <a href="<?= $plugin_data['AuthorURI'] ?>"><?= $plugin_data['Author'] ?></a><br/>
|
||||||
|
GitHub: <a href="<?= $plugin_data['PluginURI'] ?>"><?= $plugin_data['TextDomain'] ?></a><br/>
|
||||||
|
<?php if ( ! empty( $update_message ) ): ?>Last Updated: <?= $update_message ?><?php endif; ?>
|
||||||
|
</p>
|
||||||
</div><!-- .inside -->
|
</div><!-- .inside -->
|
||||||
|
|
||||||
</div><!-- .postbox -->
|
</div><!-- .postbox -->
|
||||||
@ -7,9 +7,8 @@
|
|||||||
?>
|
?>
|
||||||
<form method="post" action="options.php">
|
<form method="post" action="options.php">
|
||||||
<?php
|
<?php
|
||||||
/** @var WPHelper\AdminPage $this */
|
|
||||||
settings_fields( $this->settings_page->option_group );// Print hidden setting fields
|
settings_fields( $this->settings_page->option_group );// Print hidden setting fields
|
||||||
do_settings_sections( $this->settings_page->page );// Print title, info callback and form-table
|
do_settings_sections( $this->get_slug() );// Print title, info callback and form-table
|
||||||
submit_button();
|
submit_button();
|
||||||
?>
|
?>
|
||||||
</form>
|
</form>
|
||||||
@ -1,41 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Bootstrap WordPress core meta-boxes to generate metaboxes
|
|
||||||
*
|
|
||||||
* @var WPHelper\AdminPage $this
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
<style>
|
|
||||||
/*
|
|
||||||
we don't actually have draggable/movable metaboxes
|
|
||||||
.hide-if-no-js / hidden classes would help
|
|
||||||
*/
|
|
||||||
.handle-actions {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.postbox .postbox-header .hndle {
|
|
||||||
cursor: unset;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Allow meta-boxes to hook to this page ('side' context).
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
do_action('add_meta_boxes', $this->get_hook_suffix(), 'side' );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove 'Featured Image' meta-box added by core.
|
|
||||||
*
|
|
||||||
* @see register_and_do_post_meta_boxes() (wp-admin/includes/meta-boxes.php)
|
|
||||||
* @todo Investigate why $thumbnail_support returns true for our pages.
|
|
||||||
*/
|
|
||||||
remove_meta_box( 'postimagediv', $this->get_hook_suffix(), 'side' );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Render meta-boxes
|
|
||||||
*
|
|
||||||
* Renders div.meta-box-sortables
|
|
||||||
*/
|
|
||||||
do_meta_boxes( $this->get_hook_suffix(), 'side', null );
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Template - Tabs navigation row
|
|
||||||
*
|
|
||||||
* Print tabs navigation row.
|
|
||||||
*
|
|
||||||
* @var WPHelper\AdminPage $this
|
|
||||||
*/
|
|
||||||
do_action( "wphelper/adminpage/tab_nav/{$this->tab_group}" );
|
|
||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Print tabs navigation row.
|
* Print tabs navigation row.
|
||||||
*
|
*
|
||||||
* @var CMB2_Options_Hookup $hookup
|
* @var CMB2_Options_Hook $hookup
|
||||||
*/
|
*/
|
||||||
if ( ! isset( $hookup ) ){
|
if ( ! isset( $hookup ) ){
|
||||||
return;
|
return;
|
||||||
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Template for CMB2 Options Page
|
|
||||||
*
|
|
||||||
* @var WPHelper\CMB2_OptionsPage $this
|
|
||||||
* @var CMB2_Options_Hookup $hookup
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
<div class="wrap cmb2-options-page option-<?php echo esc_attr( sanitize_html_class( $hookup->option_key ) ); ?>">
|
|
||||||
<?php include 'title-cmb2.php' ?>
|
|
||||||
<?php include 'tab-nav-cmb2.php' ?>
|
|
||||||
<?php include 'form-cmb2.php' ?>
|
|
||||||
</div>
|
|
||||||
@ -3,12 +3,12 @@
|
|||||||
* Template for CMB2 Options Page
|
* Template for CMB2 Options Page
|
||||||
*
|
*
|
||||||
* @var string $ob_content - Render template or callback
|
* @var string $ob_content - Render template or callback
|
||||||
* @var WPHelper\AdminPage $this
|
* @var AdminPage $this
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h1><?= get_admin_page_title() ?></h1>
|
<h1><?= get_admin_page_title() ?></h1>
|
||||||
<?php include 'tab-nav-simple.php' ?>
|
<?php include 'tab-nav.php' ?>
|
||||||
<div id="poststuff">
|
<div id="poststuff">
|
||||||
<div id="post-body" class="metabox-holder columns-2">
|
<div id="post-body" class="metabox-holder columns-2">
|
||||||
|
|
||||||
@ -21,7 +21,9 @@
|
|||||||
|
|
||||||
<!-- sidebar -->
|
<!-- sidebar -->
|
||||||
<div id="postbox-container-1" class="postbox-container">
|
<div id="postbox-container-1" class="postbox-container">
|
||||||
<?php include 'sidebar-add-meta-boxes.php'; ?>
|
<div class="meta-box-sortables">
|
||||||
|
<?php do_action("wphelper/adminpage/plugin_info_box/{$this->get_slug()}"); ?>
|
||||||
|
</div><!-- .meta-box-sortables -->
|
||||||
</div><!-- #postbox-container-1 .postbox-container -->
|
</div><!-- #postbox-container-1 .postbox-container -->
|
||||||
</div><!-- #post-body -->
|
</div><!-- #post-body -->
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|||||||
@ -1,12 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Simple wrap
|
* Simple wrap
|
||||||
*
|
|
||||||
* @var string $ob_content - Render template or callback
|
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h1><?= get_admin_page_title() ?></h1>
|
<h1><?= get_admin_page_title() ?></h1>
|
||||||
<?php include 'tab-nav-simple.php' ?>
|
<?php include 'tab-nav.php' ?>
|
||||||
<?php echo $ob_content; ?>
|
<?php echo $ob_content; ?>
|
||||||
</div>
|
</div>
|
||||||
@ -1,38 +0,0 @@
|
|||||||
# Create Github Release
|
|
||||||
# v1.0
|
|
||||||
# Create Github release on tag push
|
|
||||||
# - Use tag name as release title
|
|
||||||
# - Use CHANGELOG.md log entry as body
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
# Sequence of patterns matched against refs/tags
|
|
||||||
tags:
|
|
||||||
- '*' # Match any tag
|
|
||||||
|
|
||||||
name: Create Release
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Create Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Get Changelog Entry
|
|
||||||
id: changelog_reader
|
|
||||||
uses: mindsers/changelog-reader-action@v1.1.0
|
|
||||||
with:
|
|
||||||
version: ${{ github.ref }}
|
|
||||||
path: ./CHANGELOG.md
|
|
||||||
- name: Create Release
|
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.ref }}
|
|
||||||
release_name: ${{ github.ref }}
|
|
||||||
body: ${{ steps.changelog_reader.outputs.log_entry }} # This pulls from the GET CHANGELOG ENTRY step above, referencing it's ID to get its outputs object, which include a `log_entry`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
26
vendor/abuyoyo/metabox/CHANGELOG.md
vendored
26
vendor/abuyoyo/metabox/CHANGELOG.md
vendored
@ -1,26 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
WPHelper\MetaBox
|
|
||||||
|
|
||||||
## 0.8
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix `Metabox::render()` callback arguments. Callback is passed `$data_object` and `$box`.
|
|
||||||
|
|
||||||
## 0.7
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Validate `is_callable(render_cb)` before `call_user_func` call.
|
|
||||||
|
|
||||||
## 0.6
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Accept callable `render_cb` as well as readable `render_tpl` as render template.
|
|
||||||
|
|
||||||
## 0.5
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Basic Metabox API.
|
|
||||||
220
vendor/abuyoyo/metabox/MetaBox.php
vendored
220
vendor/abuyoyo/metabox/MetaBox.php
vendored
@ -1,220 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace WPHelper;
|
|
||||||
|
|
||||||
use function wp_parse_args;
|
|
||||||
use function add_action;
|
|
||||||
use function add_meta_box;
|
|
||||||
/**
|
|
||||||
* MetaBox
|
|
||||||
*
|
|
||||||
* Object-Oriented WordPress meta box creator.
|
|
||||||
*
|
|
||||||
* @author abuyoyo
|
|
||||||
* @version 0.8
|
|
||||||
*/
|
|
||||||
class MetaBox
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Screen context where the meta box should display.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $context;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The ID of the meta box.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The display priority of the meta box.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $priority;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Screens where this meta box will appear.
|
|
||||||
*
|
|
||||||
* @var string[]
|
|
||||||
*/
|
|
||||||
private $screens;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Path to the template used to display the content of the meta box.
|
|
||||||
*
|
|
||||||
* @var string filename
|
|
||||||
*/
|
|
||||||
private $render_tpl;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Path to the template used to display the content of the meta box.
|
|
||||||
*
|
|
||||||
* @var callable
|
|
||||||
*/
|
|
||||||
private $render_cb;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The title of the meta box.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $title;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hook where this meta box will be added.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $hook;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Array of $args to be sent to callback function's second parameter
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
private $args;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
*
|
|
||||||
* @param string $id
|
|
||||||
* @param string $template
|
|
||||||
* @param string $title
|
|
||||||
* @param string $context
|
|
||||||
* @param string $priority
|
|
||||||
* @param string[] $screens
|
|
||||||
*/
|
|
||||||
public function __construct($options)
|
|
||||||
{
|
|
||||||
// should throw error if required fields (id, title) not given
|
|
||||||
// template is actually optional
|
|
||||||
|
|
||||||
$defaults = [
|
|
||||||
'context' => 'advanced',
|
|
||||||
'priority' => 'default',
|
|
||||||
'screens' => [],
|
|
||||||
'args' => null,
|
|
||||||
'hook' => 'add_meta_boxes',
|
|
||||||
];
|
|
||||||
|
|
||||||
$options = wp_parse_args( $options, $defaults );
|
|
||||||
extract($options);
|
|
||||||
|
|
||||||
$this->context = $context;
|
|
||||||
$this->id = $id;
|
|
||||||
$this->priority = $priority;
|
|
||||||
$this->screens = $screens;
|
|
||||||
$this->render_tpl = isset( $template ) ? rtrim( $template, '/' ) : '';
|
|
||||||
$this->render_cb = $render ?? '';
|
|
||||||
$this->title = $title;
|
|
||||||
$this->hook = $hook;
|
|
||||||
$this->args = $args;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add metabox at given hook.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function add()
|
|
||||||
{
|
|
||||||
add_action( $this->hook, [ $this, 'wp_add_metabox' ] );
|
|
||||||
}
|
|
||||||
|
|
||||||
public function wp_add_metabox(){
|
|
||||||
add_meta_box(
|
|
||||||
$this->id,
|
|
||||||
$this->title,
|
|
||||||
[ $this, 'render' ], // $this->render_tpl | $this->render_cb
|
|
||||||
$this->screens,
|
|
||||||
$this->context,
|
|
||||||
$this->priority,
|
|
||||||
$this->args
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the callable that will render the content of the meta box.
|
|
||||||
*
|
|
||||||
* @return callable
|
|
||||||
*/
|
|
||||||
public function get_callback()
|
|
||||||
{
|
|
||||||
return [ $this, 'render' ];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the screen context where the meta box should display.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function get_context()
|
|
||||||
{
|
|
||||||
return $this->context;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the ID of the meta box.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function get_id()
|
|
||||||
{
|
|
||||||
return $this->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the display priority of the meta box.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function get_priority()
|
|
||||||
{
|
|
||||||
return $this->priority;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the screen(s) where the meta box will appear.
|
|
||||||
*
|
|
||||||
* @return array|string|WP_Screen
|
|
||||||
*/
|
|
||||||
public function get_screens()
|
|
||||||
{
|
|
||||||
return $this->screens;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the title of the meta box.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function get_title()
|
|
||||||
{
|
|
||||||
return $this->title;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Render the content of the meta box using a PHP template.
|
|
||||||
* Callback passed to to add_meta_box()
|
|
||||||
*
|
|
||||||
* @see do_meta_boxes()
|
|
||||||
*
|
|
||||||
* @param mixed $data_object Object that's the focus of the current screen. eg. WP_Post|WP_Comment
|
|
||||||
* @param array $box Meta-box data [id, title, callback, args] (@see global $wp_meta_boxes)
|
|
||||||
*/
|
|
||||||
public function render( $data_object, $box )
|
|
||||||
{
|
|
||||||
if ( ! is_readable( $this->render_tpl ) && ! is_callable( $this->render_cb ) ){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( is_callable( $this->render_cb ) ){
|
|
||||||
call_user_func( $this->render_cb, $data_object, $box );
|
|
||||||
} else if ( isset( $this->render_tpl ) ){
|
|
||||||
include $this->render_tpl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
1
vendor/abuyoyo/metabox/README.md
vendored
1
vendor/abuyoyo/metabox/README.md
vendored
@ -1 +0,0 @@
|
|||||||
# WPHelper\MetaBox
|
|
||||||
12
vendor/abuyoyo/metabox/composer.json
vendored
12
vendor/abuyoyo/metabox/composer.json
vendored
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "abuyoyo/metabox",
|
|
||||||
"description": "WordPress metabox helper class",
|
|
||||||
"type": "library",
|
|
||||||
"version": "0.8",
|
|
||||||
"license": "BSD-3-Clause",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"WPHelper\\" : ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
24
vendor/abuyoyo/plugincore/CHANGELOG.md
vendored
24
vendor/abuyoyo/plugincore/CHANGELOG.md
vendored
@ -1,29 +1,5 @@
|
|||||||
# WPHelper\PluginCore Changelog
|
# WPHelper\PluginCore Changelog
|
||||||
|
|
||||||
## 0.27
|
|
||||||
Release Date: Oct 3, 2023
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Support Plugin Update Checker v5 as well as v4. Create class alias `WPHelper\PucFactory` for `YahnisElsts\PluginUpdateChecker\v5\PucFactory` if available. Fallback to `Puc_v4_Factory`.
|
|
||||||
|
|
||||||
## 0.26
|
|
||||||
Release Date: Jun 9, 2023
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fix passing PluginCore instance to AdminPage constructor in `admin_page()` method.
|
|
||||||
|
|
||||||
## 0.25
|
|
||||||
Release Date: Feb 3, 2023
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Property `token` and method `token`. Lowercase underscore token to be used as variable name.
|
|
||||||
|
|
||||||
## 0.24
|
|
||||||
Release Date: Jan 13, 2023
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Static `get_by_file` method. Get PluginCore instance by plugin filename.
|
|
||||||
|
|
||||||
## 0.23
|
## 0.23
|
||||||
Release Date: Aug 8, 2022
|
Release Date: Aug 8, 2022
|
||||||
|
|
||||||
|
|||||||
158
vendor/abuyoyo/plugincore/PluginCore.php
vendored
158
vendor/abuyoyo/plugincore/PluginCore.php
vendored
@ -1,23 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace WPHelper;
|
namespace WPHelper;
|
||||||
|
|
||||||
|
use Puc_v4_Factory;
|
||||||
|
|
||||||
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
defined( 'ABSPATH' ) || die( 'No soup for you!' );
|
||||||
|
|
||||||
if ( ! class_exists( 'WPHelper/PluginCore' ) ):
|
if( ! function_exists('get_plugin_data') ) {
|
||||||
|
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||||
// require dependency get_plugin_data()
|
|
||||||
if( ! function_exists( 'get_plugin_data' ) ) {
|
|
||||||
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! class_exists( 'WPHelper/PluginCore' ) ):
|
||||||
/**
|
/**
|
||||||
* PluginCore
|
* PluginCore
|
||||||
*
|
*
|
||||||
* Helper Class for creating WordPress Plugins
|
* Helper Class for creating WordPress Plugins
|
||||||
*
|
*
|
||||||
|
* Defines PLUGIN_PATH, PLUGIN_URL (etc.) constants
|
||||||
* (@see README.md)
|
* (@see README.md)
|
||||||
*
|
*
|
||||||
* @version 0.27
|
* @version 0.23
|
||||||
*/
|
*/
|
||||||
class PluginCore {
|
class PluginCore {
|
||||||
|
|
||||||
@ -41,11 +42,6 @@ class PluginCore {
|
|||||||
*/
|
*/
|
||||||
private $const;
|
private $const;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $token;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
@ -61,11 +57,6 @@ class PluginCore {
|
|||||||
*/
|
*/
|
||||||
private $plugin_basename;
|
private $plugin_basename;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array plugin header metadata
|
|
||||||
*/
|
|
||||||
private $plugin_data;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var callable
|
* @var callable
|
||||||
*/
|
*/
|
||||||
@ -116,20 +107,19 @@ class PluginCore {
|
|||||||
*/
|
*/
|
||||||
private $update_branch;
|
private $update_branch;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Static array of all PluginCore instances
|
* Static array of all PluginCore instances
|
||||||
* Used in PluginCore::get($slug)
|
* Used in PluginCore::get($slug)
|
||||||
*
|
*
|
||||||
* @var array[PluginCore] Instances of PluginCore
|
* @var array[PluginCore] Instances of PluginCore
|
||||||
*/
|
*/
|
||||||
private static $cores = [];
|
static $cores = [];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve instance of PluginCore by plugin slug.
|
* Retrieve instance of PluginCore by plugin slug.
|
||||||
*
|
*
|
||||||
* @since 0.5
|
|
||||||
*
|
|
||||||
* @param string $slug - Plugin slug
|
* @param string $slug - Plugin slug
|
||||||
* @return PluginCore - Instance of specific plugin.
|
* @return PluginCore - Instance of specific plugin.
|
||||||
*/
|
*/
|
||||||
@ -137,29 +127,6 @@ class PluginCore {
|
|||||||
return self::$cores[ $slug ] ?? null;
|
return self::$cores[ $slug ] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve instance of PluginCore by plugin __FILE__.
|
|
||||||
*
|
|
||||||
* @since 0.24
|
|
||||||
*
|
|
||||||
* @param string $filename - Plugin filename
|
|
||||||
* @return PluginCore - Instance of specific plugin.
|
|
||||||
*/
|
|
||||||
static public function get_by_file( $filename ) {
|
|
||||||
return current(
|
|
||||||
array_filter(
|
|
||||||
self::$cores,
|
|
||||||
fn($core) => $core->file() == $filename
|
|
||||||
)
|
|
||||||
) ?: null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @since 0.1
|
|
||||||
* @since 0.2 Accept filename as first param and options array as optional param
|
|
||||||
*/
|
|
||||||
function __construct( $plugin_file, $options = null ) {
|
function __construct( $plugin_file, $options = null ) {
|
||||||
|
|
||||||
$this->plugin_file( $plugin_file );
|
$this->plugin_file( $plugin_file );
|
||||||
@ -174,8 +141,6 @@ class PluginCore {
|
|||||||
|
|
||||||
$this->const( $options->const ?? null ); // fallback: generate const from slug
|
$this->const( $options->const ?? null ); // fallback: generate const from slug
|
||||||
|
|
||||||
$this->token( $options->token ?? null ); // fallback: generate token from slug
|
|
||||||
|
|
||||||
if ( isset( $options->activate_cb ) )
|
if ( isset( $options->activate_cb ) )
|
||||||
$this->activate_cb( $options->activate_cb );
|
$this->activate_cb( $options->activate_cb );
|
||||||
|
|
||||||
@ -212,9 +177,6 @@ class PluginCore {
|
|||||||
* Register activation, deactivation, uninstall, upgrade hooks.
|
* Register activation, deactivation, uninstall, upgrade hooks.
|
||||||
* Init PUC update checker.
|
* Init PUC update checker.
|
||||||
*
|
*
|
||||||
* @since 0.1 setup()
|
|
||||||
* @since 0.21 bootstrap()
|
|
||||||
*
|
|
||||||
* @todo set plugin_dir_path, plugin_basename as accessible public variables (available thru methods atm)
|
* @todo set plugin_dir_path, plugin_basename as accessible public variables (available thru methods atm)
|
||||||
*/
|
*/
|
||||||
private function bootstrap() {
|
private function bootstrap() {
|
||||||
@ -254,11 +216,6 @@ class PluginCore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Register activation/deactivation/uninstall/upgrade hooks
|
|
||||||
*
|
|
||||||
* @since 0.5
|
|
||||||
*/
|
|
||||||
private function register_hooks() {
|
private function register_hooks() {
|
||||||
|
|
||||||
if ( ! empty( $this->activate_cb ) ) // && is_callable() ?
|
if ( ! empty( $this->activate_cb ) ) // && is_callable() ?
|
||||||
@ -279,8 +236,6 @@ class PluginCore {
|
|||||||
* Plugin title.
|
* Plugin title.
|
||||||
* If none provided - plugin header Title will be used.
|
* If none provided - plugin header Title will be used.
|
||||||
*
|
*
|
||||||
* @since 0.1
|
|
||||||
*
|
|
||||||
* @param string|null $title
|
* @param string|null $title
|
||||||
* @return string $this->title
|
* @return string $this->title
|
||||||
*/
|
*/
|
||||||
@ -291,8 +246,6 @@ class PluginCore {
|
|||||||
/**
|
/**
|
||||||
* Wrapper function for $this->title()
|
* Wrapper function for $this->title()
|
||||||
*
|
*
|
||||||
* @since 0.6
|
|
||||||
*
|
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public function name( $title = null ) {
|
public function name( $title = null ) {
|
||||||
@ -305,8 +258,6 @@ class PluginCore {
|
|||||||
* Plugin slug.
|
* Plugin slug.
|
||||||
* If none provided - plugin file basename will be used
|
* If none provided - plugin file basename will be used
|
||||||
*
|
*
|
||||||
* @since 0.1
|
|
||||||
*
|
|
||||||
* @param string|null $slug
|
* @param string|null $slug
|
||||||
* @return string $this->slug
|
* @return string $this->slug
|
||||||
*/
|
*/
|
||||||
@ -318,8 +269,6 @@ class PluginCore {
|
|||||||
* Setter - plugin_file (also Getter - kinda)
|
* Setter - plugin_file (also Getter - kinda)
|
||||||
* Plugin file fully qualified path.
|
* Plugin file fully qualified path.
|
||||||
*
|
*
|
||||||
* @since 0.1
|
|
||||||
*
|
|
||||||
* @param string $plugin_file - Path to plugin file
|
* @param string $plugin_file - Path to plugin file
|
||||||
* @return string $this->plugin_file
|
* @return string $this->plugin_file
|
||||||
*/
|
*/
|
||||||
@ -332,8 +281,6 @@ class PluginCore {
|
|||||||
* Might have to rethink this
|
* Might have to rethink this
|
||||||
* used by test-plugin update_checker
|
* used by test-plugin update_checker
|
||||||
*
|
*
|
||||||
* @since 0.7
|
|
||||||
*
|
|
||||||
* @todo revisit this
|
* @todo revisit this
|
||||||
*/
|
*/
|
||||||
public function file() {
|
public function file() {
|
||||||
@ -343,11 +290,9 @@ class PluginCore {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter/Setter - plugin data array
|
* Getter/Setter - plugin data array
|
||||||
*
|
|
||||||
* @since 0.14
|
|
||||||
*/
|
*/
|
||||||
public function plugin_data() {
|
public function plugin_data() {
|
||||||
return $this->plugin_data ??= get_plugin_data( $this->plugin_file, false ); // false = no markup (i think)
|
return $this->plugin_data ??= get_plugin_data( $this->plugin_file, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -355,8 +300,6 @@ class PluginCore {
|
|||||||
* Prefix of plugin specific defines (PLUGIN_NAME_PATH etc.)
|
* Prefix of plugin specific defines (PLUGIN_NAME_PATH etc.)
|
||||||
* If not provided - plugin slug will be uppercase.
|
* If not provided - plugin slug will be uppercase.
|
||||||
*
|
*
|
||||||
* @since 0.4
|
|
||||||
*
|
|
||||||
* @param string|null $const (string should be uppercase)
|
* @param string|null $const (string should be uppercase)
|
||||||
* @return string $this->const
|
* @return string $this->const
|
||||||
*/
|
*/
|
||||||
@ -364,23 +307,8 @@ class PluginCore {
|
|||||||
return $this->const ??= $const ?: str_replace( '-', '_' , strtoupper( $this->slug() ) );
|
return $this->const ??= $const ?: str_replace( '-', '_' , strtoupper( $this->slug() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Getter/Setter - token
|
|
||||||
* Create a single-token slug (convert to underscore + lowercase).
|
|
||||||
*
|
|
||||||
* @since 0.25
|
|
||||||
*
|
|
||||||
* @param string|null $token (string will be normalized)
|
|
||||||
* @return string $this->token
|
|
||||||
*/
|
|
||||||
public function token( $token = null ) {
|
|
||||||
return $this->token ??= str_replace( '-', '_' , strtolower( $token ?: $this->slug() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter/setter
|
* Getter/setter
|
||||||
*
|
|
||||||
* @since 0.6
|
|
||||||
*/
|
*/
|
||||||
public function path() {
|
public function path() {
|
||||||
return $this->path ??= plugin_dir_path( $this->plugin_file );
|
return $this->path ??= plugin_dir_path( $this->plugin_file );
|
||||||
@ -388,8 +316,6 @@ class PluginCore {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter/Setter
|
* Getter/Setter
|
||||||
*
|
|
||||||
* @since 0.6
|
|
||||||
*/
|
*/
|
||||||
public function url() {
|
public function url() {
|
||||||
return $this->url ??= plugin_dir_url( $this->plugin_file );
|
return $this->url ??= plugin_dir_url( $this->plugin_file );
|
||||||
@ -397,8 +323,6 @@ class PluginCore {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter/Setter
|
* Getter/Setter
|
||||||
*
|
|
||||||
* @since 0.12
|
|
||||||
*/
|
*/
|
||||||
public function plugin_basename() {
|
public function plugin_basename() {
|
||||||
return $this->plugin_basename ??= plugin_basename( $this->plugin_file );
|
return $this->plugin_basename ??= plugin_basename( $this->plugin_file );
|
||||||
@ -409,8 +333,6 @@ class PluginCore {
|
|||||||
* Callback runs on 'register_activation_hook'
|
* Callback runs on 'register_activation_hook'
|
||||||
* PluginCore does not validate. Authors must ensure valid callback.
|
* PluginCore does not validate. Authors must ensure valid callback.
|
||||||
*
|
*
|
||||||
* @since 0.4
|
|
||||||
*
|
|
||||||
* @param callable $activate_cb - Activation callback
|
* @param callable $activate_cb - Activation callback
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
@ -424,8 +346,6 @@ class PluginCore {
|
|||||||
* Callback runs on 'register_deactivation_hook'
|
* Callback runs on 'register_deactivation_hook'
|
||||||
* PluginCore does not validate. Authors must ensure valid callback.
|
* PluginCore does not validate. Authors must ensure valid callback.
|
||||||
*
|
*
|
||||||
* @since 0.4
|
|
||||||
*
|
|
||||||
* @param callable $deactivate_cb - Deactivation callback.
|
* @param callable $deactivate_cb - Deactivation callback.
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
@ -439,8 +359,6 @@ class PluginCore {
|
|||||||
* Callback runs on 'register_uninstall_hook'
|
* Callback runs on 'register_uninstall_hook'
|
||||||
* PluginCore does not validate. Authors must ensure valid callback.
|
* PluginCore does not validate. Authors must ensure valid callback.
|
||||||
*
|
*
|
||||||
* @since 0.4
|
|
||||||
*
|
|
||||||
* @param callable $uninstall_cb - Uninstall callback.
|
* @param callable $uninstall_cb - Uninstall callback.
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
@ -457,8 +375,6 @@ class PluginCore {
|
|||||||
*
|
*
|
||||||
* PluginCore does not validate. Authors must ensure valid callback.
|
* PluginCore does not validate. Authors must ensure valid callback.
|
||||||
*
|
*
|
||||||
* @since 0.11
|
|
||||||
*
|
|
||||||
* @param callable $upgrade_cb - Upgrade callback.
|
* @param callable $upgrade_cb - Upgrade callback.
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
@ -493,25 +409,24 @@ class PluginCore {
|
|||||||
*
|
*
|
||||||
* Construct AdminPage instance for plugin.
|
* Construct AdminPage instance for plugin.
|
||||||
*
|
*
|
||||||
* @since 0.14
|
|
||||||
* @since 0.17 - Pass instance of PluginCore to AdminPage (~0.14)
|
|
||||||
*
|
|
||||||
* @param array $admin_page - AdminPage settings array
|
* @param array $admin_page - AdminPage settings array
|
||||||
|
*
|
||||||
* @return AdminPage
|
* @return AdminPage
|
||||||
*/
|
*/
|
||||||
public function admin_page( $admin_page ) {
|
public function admin_page( $admin_page ) {
|
||||||
|
|
||||||
if ( ! class_exists( AdminPage::class ) )
|
if ( ! class_exists( 'WPHelper\AdminPage' ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( ! isset( $this->admin_page ) ){
|
// validate
|
||||||
|
$admin_page['slug'] ??= $this->slug();
|
||||||
|
$admin_page['title'] ??= $this->title();
|
||||||
|
|
||||||
// validate
|
$this->admin_page = new AdminPage( $admin_page );
|
||||||
$admin_page['slug'] ??= $this->slug();
|
|
||||||
$admin_page['title'] ??= $this->title();
|
|
||||||
$admin_page['plugin_core'] ??= $this;
|
|
||||||
|
|
||||||
$this->admin_page = new AdminPage( $admin_page );
|
// validate for older versions of AdminPage
|
||||||
|
if ( method_exists( $this->admin_page, 'plugin_core' ) ) {
|
||||||
|
$this->admin_page->plugin_core( $this ); // back-reference
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->admin_page;
|
return $this->admin_page;
|
||||||
@ -520,15 +435,13 @@ class PluginCore {
|
|||||||
/**
|
/**
|
||||||
* Setter
|
* Setter
|
||||||
*
|
*
|
||||||
* Setup info used by PucFactory
|
* Setup info used by Puc_v4_Factory
|
||||||
*
|
*
|
||||||
* set $update_checker (bool)
|
* set $update_checker (bool)
|
||||||
* set $update_repo_uri (string)
|
* set $update_repo_uri (string)
|
||||||
* set $update_auth (optional)
|
* set $update_auth (optional)
|
||||||
* set $update_branch (optional)
|
* set $update_branch (optional)
|
||||||
*
|
*
|
||||||
* @since 0.9
|
|
||||||
*
|
|
||||||
* @param bool|string|array $update_checker
|
* @param bool|string|array $update_checker
|
||||||
*/
|
*/
|
||||||
private function update_checker( $update_checker ) {
|
private function update_checker( $update_checker ) {
|
||||||
@ -577,35 +490,14 @@ class PluginCore {
|
|||||||
/**
|
/**
|
||||||
* Init Puc update checker instance
|
* Init Puc update checker instance
|
||||||
*
|
*
|
||||||
* @since 0.9 init_update_checker()
|
* @uses Puc_v4_Factory::buildUpdateChecker
|
||||||
* @since 0.21 build_update_checker()
|
|
||||||
* @since 0.27 Create class alias WPHelper\PucFactory - support plugin-update-checker v4 & v5
|
|
||||||
*
|
|
||||||
* @uses PucFactory::buildUpdateChecker
|
|
||||||
*/
|
*/
|
||||||
private function build_update_checker() {
|
private function build_update_checker() {
|
||||||
|
|
||||||
/**
|
if ( ! class_exists('Puc_v4_Factory') )
|
||||||
* Create class alias WPHelper\PucFactory
|
|
||||||
* Support YahnisElsts\PluginUpdateChecker v4 | v5
|
|
||||||
*
|
|
||||||
* @since 0.27
|
|
||||||
*/
|
|
||||||
if ( ! class_exists( 'WPHelper\PucFactory' ) ) {
|
|
||||||
if ( class_exists( 'YahnisElsts\PluginUpdateChecker\v5\PucFactory' ) ) {
|
|
||||||
$actual_puc = 'YahnisElsts\PluginUpdateChecker\v5\PucFactory';
|
|
||||||
} else if ( class_exists( 'Puc_v4_Factory' ) ) {
|
|
||||||
$actual_puc = 'Puc_v4_Factory';
|
|
||||||
}
|
|
||||||
if ( ! empty( $actual_puc ) ) {
|
|
||||||
class_alias( $actual_puc, 'WPHelper\PucFactory' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! class_exists( 'WPHelper\PucFactory' ) )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$update_checker = PucFactory::buildUpdateChecker(
|
$update_checker = Puc_v4_Factory::buildUpdateChecker(
|
||||||
$this->update_repo_uri,
|
$this->update_repo_uri,
|
||||||
$this->plugin_file,
|
$this->plugin_file,
|
||||||
$this->slug() // using slug()
|
$this->slug() // using slug()
|
||||||
@ -628,8 +520,6 @@ class PluginCore {
|
|||||||
* This function called on upgrader_process_complete
|
* This function called on upgrader_process_complete
|
||||||
* sanity-checks if our plugin was upgraded
|
* sanity-checks if our plugin was upgraded
|
||||||
* if so - calls upgrade_cb provided by our plugin
|
* if so - calls upgrade_cb provided by our plugin
|
||||||
*
|
|
||||||
* @since 0.12
|
|
||||||
*/
|
*/
|
||||||
public function upgrade_cb_wrapper( $upgrader_object, $options ) {
|
public function upgrade_cb_wrapper( $upgrader_object, $options ) {
|
||||||
if(
|
if(
|
||||||
|
|||||||
8
vendor/abuyoyo/plugincore/composer.json
vendored
8
vendor/abuyoyo/plugincore/composer.json
vendored
@ -2,12 +2,12 @@
|
|||||||
"name": "abuyoyo/plugincore",
|
"name": "abuyoyo/plugincore",
|
||||||
"description": "WordPress plugin core helper class",
|
"description": "WordPress plugin core helper class",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"version": "0.27",
|
"version": "0.23",
|
||||||
"time": "2022-10-03",
|
"time": "2022-08-06",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"yahnis-elsts/plugin-update-checker": "~5.2",
|
"yahnis-elsts/plugin-update-checker": "~4.12",
|
||||||
"abuyoyo/adminmenupage": "~0.27"
|
"abuyoyo/adminmenupage": "~0.20"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
10
vendor/abuyoyo/screen-meta-links/CHANGELOG.md
vendored
10
vendor/abuyoyo/screen-meta-links/CHANGELOG.md
vendored
@ -2,16 +2,6 @@
|
|||||||
|
|
||||||
API for adding custom `screen-meta-links` links and panels alongside the 'Screen Options' and 'Help' links on the WordPress admin page.
|
API for adding custom `screen-meta-links` links and panels alongside the 'Screen Options' and 'Help' links on the WordPress admin page.
|
||||||
|
|
||||||
## [0.13](https://github.com/abuyoyo/screen-meta-links/releases/tag/0.13)
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fix PHP 8.2 depreacted: Optional parameter declared before required parameter.
|
|
||||||
|
|
||||||
## [0.12](https://github.com/abuyoyo/screen-meta-links/releases/tag/0.12)
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fix PHP notice: Constant already defined.
|
|
||||||
|
|
||||||
## [0.11](https://github.com/abuyoyo/screen-meta-links/releases/tag/0.11)
|
## [0.11](https://github.com/abuyoyo/screen-meta-links/releases/tag/0.11)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Plugin Name: abuyoyo / Screen Meta Links
|
* Plugin Name: abuyoyo / Screen Meta Links
|
||||||
* Description: API for adding custom screen-meta-links alongside the "Screen Options" and "Help" links.
|
* Description: API for adding custom screen-meta-links alongside the "Screen Options" and "Help" links.
|
||||||
* Version: 0.13
|
* Version: 0.11
|
||||||
* Author: abuyoyo
|
* Author: abuyoyo
|
||||||
* Author URI: https://github.com/abuyoyo
|
* Author URI: https://github.com/abuyoyo
|
||||||
* Plugin URI: https://github.com/abuyoyo/screen-meta-links
|
* Plugin URI: https://github.com/abuyoyo/screen-meta-links
|
||||||
@ -16,9 +16,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
! defined( 'SML_FILE' ) && define ( 'SML_FILE', __FILE__ );
|
if ( ! defined( 'SML_FILE' ) ) define ( 'SML_FILE', __FILE__ );
|
||||||
! defined( 'SML_URL' ) && define ( 'SML_URL' , plugin_dir_url( __FILE__ ) );
|
if ( ! defined( 'SML_URL' ) ) define ( 'SML_URL', plugin_dir_url( __FILE__ ) );
|
||||||
! defined( 'SML_PATH' ) && define ( 'SML_PATH', plugin_dir_path( __FILE__ ) );
|
if ( ! defined( 'SML_PATH' ) ) define ( 'SML_PATH', plugin_dir_path( __FILE__ ) );
|
||||||
|
|
||||||
if ( ! class_exists('Screen_Meta_Links') ):
|
if ( ! class_exists('Screen_Meta_Links') ):
|
||||||
|
|
||||||
@ -352,15 +352,14 @@ if ( ! function_exists( 'wph_add_screen_meta_panel' ) ):
|
|||||||
* @param string $id - Link ID. Should be unique and a valid value for a HTML ID attribute.
|
* @param string $id - Link ID. Should be unique and a valid value for a HTML ID attribute.
|
||||||
* @param string $text - Link text.
|
* @param string $text - Link text.
|
||||||
* @param string $href - Optional. Link URL to be used if no panel is provided
|
* @param string $href - Optional. Link URL to be used if no panel is provided
|
||||||
* @param string|array $page - Optional. The page(s) where you want to add the link. Accepts wildcard '*'. If left empty will not add to any page.
|
* @param string|array $page - The page(s) where you want to add the link.
|
||||||
* @param array $attributes - Optional. Additional attributes for the link tag. Add 'aria-controls' => "{$id}-wrap" to toggle panel
|
* @param array $attributes - Optional. Additional attributes for the link tag. Add 'aria-controls' => "{$id}-wrap" to toggle panel
|
||||||
* @param callback $panel - Optional. Callback should print out screen-meta panel contents
|
* @param callback $panel - Optional. Callback should print out screen-meta panel contents
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @todo Remove $href parameter and functionailty
|
* @todo Remove $href parameter and functionailty
|
||||||
* @todo $page should not be optional. We need to remove $href first.
|
|
||||||
*/
|
*/
|
||||||
function wph_add_screen_meta_panel( $id, $text, $href = '', $page = '', $attributes = null, $panel = '' ){
|
function wph_add_screen_meta_panel($id, $text, $href = '', $page, $attributes = null, $panel=''){
|
||||||
|
|
||||||
static $sml_instance = null;
|
static $sml_instance = null;
|
||||||
if ( null === $sml_instance){
|
if ( null === $sml_instance){
|
||||||
|
|||||||
20
vendor/autoload.php
vendored
20
vendor/autoload.php
vendored
@ -2,24 +2,6 @@
|
|||||||
|
|
||||||
// autoload.php @generated by Composer
|
// autoload.php @generated by Composer
|
||||||
|
|
||||||
if (PHP_VERSION_ID < 50600) {
|
|
||||||
if (!headers_sent()) {
|
|
||||||
header('HTTP/1.1 500 Internal Server Error');
|
|
||||||
}
|
|
||||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
|
||||||
if (!ini_get('display_errors')) {
|
|
||||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
|
||||||
fwrite(STDERR, $err);
|
|
||||||
} elseif (!headers_sent()) {
|
|
||||||
echo $err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
trigger_error(
|
|
||||||
$err,
|
|
||||||
E_USER_ERROR
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInita13a895834453aad32a897cc456c73ff::getLoader();
|
return ComposerAutoloaderInit99e41faf4c8cd1b54927a50ca0e7ee5c::getLoader();
|
||||||
|
|||||||
166
vendor/composer/ClassLoader.php
vendored
166
vendor/composer/ClassLoader.php
vendored
@ -42,76 +42,30 @@ namespace Composer\Autoload;
|
|||||||
*/
|
*/
|
||||||
class ClassLoader
|
class ClassLoader
|
||||||
{
|
{
|
||||||
/** @var \Closure(string):void */
|
|
||||||
private static $includeFile;
|
|
||||||
|
|
||||||
/** @var string|null */
|
|
||||||
private $vendorDir;
|
private $vendorDir;
|
||||||
|
|
||||||
// PSR-4
|
// PSR-4
|
||||||
/**
|
|
||||||
* @var array<string, array<string, int>>
|
|
||||||
*/
|
|
||||||
private $prefixLengthsPsr4 = array();
|
private $prefixLengthsPsr4 = array();
|
||||||
/**
|
|
||||||
* @var array<string, list<string>>
|
|
||||||
*/
|
|
||||||
private $prefixDirsPsr4 = array();
|
private $prefixDirsPsr4 = array();
|
||||||
/**
|
|
||||||
* @var list<string>
|
|
||||||
*/
|
|
||||||
private $fallbackDirsPsr4 = array();
|
private $fallbackDirsPsr4 = array();
|
||||||
|
|
||||||
// PSR-0
|
// PSR-0
|
||||||
/**
|
|
||||||
* List of PSR-0 prefixes
|
|
||||||
*
|
|
||||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
|
||||||
*
|
|
||||||
* @var array<string, array<string, list<string>>>
|
|
||||||
*/
|
|
||||||
private $prefixesPsr0 = array();
|
private $prefixesPsr0 = array();
|
||||||
/**
|
|
||||||
* @var list<string>
|
|
||||||
*/
|
|
||||||
private $fallbackDirsPsr0 = array();
|
private $fallbackDirsPsr0 = array();
|
||||||
|
|
||||||
/** @var bool */
|
|
||||||
private $useIncludePath = false;
|
private $useIncludePath = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array<string, string>
|
|
||||||
*/
|
|
||||||
private $classMap = array();
|
private $classMap = array();
|
||||||
|
|
||||||
/** @var bool */
|
|
||||||
private $classMapAuthoritative = false;
|
private $classMapAuthoritative = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array<string, bool>
|
|
||||||
*/
|
|
||||||
private $missingClasses = array();
|
private $missingClasses = array();
|
||||||
|
|
||||||
/** @var string|null */
|
|
||||||
private $apcuPrefix;
|
private $apcuPrefix;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array<string, self>
|
|
||||||
*/
|
|
||||||
private static $registeredLoaders = array();
|
private static $registeredLoaders = array();
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string|null $vendorDir
|
|
||||||
*/
|
|
||||||
public function __construct($vendorDir = null)
|
public function __construct($vendorDir = null)
|
||||||
{
|
{
|
||||||
$this->vendorDir = $vendorDir;
|
$this->vendorDir = $vendorDir;
|
||||||
self::initializeIncludeClosure();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array<string, list<string>>
|
|
||||||
*/
|
|
||||||
public function getPrefixes()
|
public function getPrefixes()
|
||||||
{
|
{
|
||||||
if (!empty($this->prefixesPsr0)) {
|
if (!empty($this->prefixesPsr0)) {
|
||||||
@ -121,42 +75,28 @@ class ClassLoader
|
|||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array<string, list<string>>
|
|
||||||
*/
|
|
||||||
public function getPrefixesPsr4()
|
public function getPrefixesPsr4()
|
||||||
{
|
{
|
||||||
return $this->prefixDirsPsr4;
|
return $this->prefixDirsPsr4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return list<string>
|
|
||||||
*/
|
|
||||||
public function getFallbackDirs()
|
public function getFallbackDirs()
|
||||||
{
|
{
|
||||||
return $this->fallbackDirsPsr0;
|
return $this->fallbackDirsPsr0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return list<string>
|
|
||||||
*/
|
|
||||||
public function getFallbackDirsPsr4()
|
public function getFallbackDirsPsr4()
|
||||||
{
|
{
|
||||||
return $this->fallbackDirsPsr4;
|
return $this->fallbackDirsPsr4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array<string, string> Array of classname => path
|
|
||||||
*/
|
|
||||||
public function getClassMap()
|
public function getClassMap()
|
||||||
{
|
{
|
||||||
return $this->classMap;
|
return $this->classMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<string, string> $classMap Class to filename map
|
* @param array $classMap Class to filename map
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function addClassMap(array $classMap)
|
public function addClassMap(array $classMap)
|
||||||
{
|
{
|
||||||
@ -171,25 +111,22 @@ class ClassLoader
|
|||||||
* Registers a set of PSR-0 directories for a given prefix, either
|
* Registers a set of PSR-0 directories for a given prefix, either
|
||||||
* appending or prepending to the ones previously set for this prefix.
|
* appending or prepending to the ones previously set for this prefix.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix
|
* @param string $prefix The prefix
|
||||||
* @param list<string>|string $paths The PSR-0 root directories
|
* @param array|string $paths The PSR-0 root directories
|
||||||
* @param bool $prepend Whether to prepend the directories
|
* @param bool $prepend Whether to prepend the directories
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function add($prefix, $paths, $prepend = false)
|
public function add($prefix, $paths, $prepend = false)
|
||||||
{
|
{
|
||||||
$paths = (array) $paths;
|
|
||||||
if (!$prefix) {
|
if (!$prefix) {
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->fallbackDirsPsr0 = array_merge(
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
$paths,
|
(array) $paths,
|
||||||
$this->fallbackDirsPsr0
|
$this->fallbackDirsPsr0
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->fallbackDirsPsr0 = array_merge(
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
$this->fallbackDirsPsr0,
|
$this->fallbackDirsPsr0,
|
||||||
$paths
|
(array) $paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,19 +135,19 @@ class ClassLoader
|
|||||||
|
|
||||||
$first = $prefix[0];
|
$first = $prefix[0];
|
||||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
$paths,
|
(array) $paths,
|
||||||
$this->prefixesPsr0[$first][$prefix]
|
$this->prefixesPsr0[$first][$prefix]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
$this->prefixesPsr0[$first][$prefix],
|
$this->prefixesPsr0[$first][$prefix],
|
||||||
$paths
|
(array) $paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -219,28 +156,25 @@ class ClassLoader
|
|||||||
* Registers a set of PSR-4 directories for a given namespace, either
|
* Registers a set of PSR-4 directories for a given namespace, either
|
||||||
* appending or prepending to the ones previously set for this namespace.
|
* appending or prepending to the ones previously set for this namespace.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
* @param list<string>|string $paths The PSR-4 base directories
|
* @param array|string $paths The PSR-4 base directories
|
||||||
* @param bool $prepend Whether to prepend the directories
|
* @param bool $prepend Whether to prepend the directories
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function addPsr4($prefix, $paths, $prepend = false)
|
public function addPsr4($prefix, $paths, $prepend = false)
|
||||||
{
|
{
|
||||||
$paths = (array) $paths;
|
|
||||||
if (!$prefix) {
|
if (!$prefix) {
|
||||||
// Register directories for the root namespace.
|
// Register directories for the root namespace.
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->fallbackDirsPsr4 = array_merge(
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
$paths,
|
(array) $paths,
|
||||||
$this->fallbackDirsPsr4
|
$this->fallbackDirsPsr4
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->fallbackDirsPsr4 = array_merge(
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
$this->fallbackDirsPsr4,
|
$this->fallbackDirsPsr4,
|
||||||
$paths
|
(array) $paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||||
@ -250,18 +184,18 @@ class ClassLoader
|
|||||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||||
}
|
}
|
||||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||||
} elseif ($prepend) {
|
} elseif ($prepend) {
|
||||||
// Prepend directories for an already registered namespace.
|
// Prepend directories for an already registered namespace.
|
||||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
$paths,
|
(array) $paths,
|
||||||
$this->prefixDirsPsr4[$prefix]
|
$this->prefixDirsPsr4[$prefix]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Append directories for an already registered namespace.
|
// Append directories for an already registered namespace.
|
||||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
$this->prefixDirsPsr4[$prefix],
|
$this->prefixDirsPsr4[$prefix],
|
||||||
$paths
|
(array) $paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -270,10 +204,8 @@ class ClassLoader
|
|||||||
* Registers a set of PSR-0 directories for a given prefix,
|
* Registers a set of PSR-0 directories for a given prefix,
|
||||||
* replacing any others previously set for this prefix.
|
* replacing any others previously set for this prefix.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix
|
* @param string $prefix The prefix
|
||||||
* @param list<string>|string $paths The PSR-0 base directories
|
* @param array|string $paths The PSR-0 base directories
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function set($prefix, $paths)
|
public function set($prefix, $paths)
|
||||||
{
|
{
|
||||||
@ -288,12 +220,10 @@ class ClassLoader
|
|||||||
* Registers a set of PSR-4 directories for a given namespace,
|
* Registers a set of PSR-4 directories for a given namespace,
|
||||||
* replacing any others previously set for this namespace.
|
* replacing any others previously set for this namespace.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
* @param list<string>|string $paths The PSR-4 base directories
|
* @param array|string $paths The PSR-4 base directories
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function setPsr4($prefix, $paths)
|
public function setPsr4($prefix, $paths)
|
||||||
{
|
{
|
||||||
@ -313,8 +243,6 @@ class ClassLoader
|
|||||||
* Turns on searching the include path for class files.
|
* Turns on searching the include path for class files.
|
||||||
*
|
*
|
||||||
* @param bool $useIncludePath
|
* @param bool $useIncludePath
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function setUseIncludePath($useIncludePath)
|
public function setUseIncludePath($useIncludePath)
|
||||||
{
|
{
|
||||||
@ -337,8 +265,6 @@ class ClassLoader
|
|||||||
* that have not been registered with the class map.
|
* that have not been registered with the class map.
|
||||||
*
|
*
|
||||||
* @param bool $classMapAuthoritative
|
* @param bool $classMapAuthoritative
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||||
{
|
{
|
||||||
@ -359,8 +285,6 @@ class ClassLoader
|
|||||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||||
*
|
*
|
||||||
* @param string|null $apcuPrefix
|
* @param string|null $apcuPrefix
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function setApcuPrefix($apcuPrefix)
|
public function setApcuPrefix($apcuPrefix)
|
||||||
{
|
{
|
||||||
@ -381,8 +305,6 @@ class ClassLoader
|
|||||||
* Registers this instance as an autoloader.
|
* Registers this instance as an autoloader.
|
||||||
*
|
*
|
||||||
* @param bool $prepend Whether to prepend the autoloader or not
|
* @param bool $prepend Whether to prepend the autoloader or not
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function register($prepend = false)
|
public function register($prepend = false)
|
||||||
{
|
{
|
||||||
@ -402,8 +324,6 @@ class ClassLoader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unregisters this instance as an autoloader.
|
* Unregisters this instance as an autoloader.
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function unregister()
|
public function unregister()
|
||||||
{
|
{
|
||||||
@ -423,8 +343,7 @@ class ClassLoader
|
|||||||
public function loadClass($class)
|
public function loadClass($class)
|
||||||
{
|
{
|
||||||
if ($file = $this->findFile($class)) {
|
if ($file = $this->findFile($class)) {
|
||||||
$includeFile = self::$includeFile;
|
includeFile($file);
|
||||||
$includeFile($file);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -475,20 +394,15 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
||||||
*
|
*
|
||||||
* @return array<string, self>
|
* @return self[]
|
||||||
*/
|
*/
|
||||||
public static function getRegisteredLoaders()
|
public static function getRegisteredLoaders()
|
||||||
{
|
{
|
||||||
return self::$registeredLoaders;
|
return self::$registeredLoaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $class
|
|
||||||
* @param string $ext
|
|
||||||
* @return string|false
|
|
||||||
*/
|
|
||||||
private function findFileWithExtension($class, $ext)
|
private function findFileWithExtension($class, $ext)
|
||||||
{
|
{
|
||||||
// PSR-4 lookup
|
// PSR-4 lookup
|
||||||
@ -554,26 +468,14 @@ class ClassLoader
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return void
|
/**
|
||||||
*/
|
* Scope isolated include.
|
||||||
private static function initializeIncludeClosure()
|
*
|
||||||
{
|
* Prevents access to $this/self from included files.
|
||||||
if (self::$includeFile !== null) {
|
*/
|
||||||
return;
|
function includeFile($file)
|
||||||
}
|
{
|
||||||
|
include $file;
|
||||||
/**
|
|
||||||
* Scope isolated include.
|
|
||||||
*
|
|
||||||
* Prevents access to $this/self from included files.
|
|
||||||
*
|
|
||||||
* @param string $file
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
self::$includeFile = \Closure::bind(static function($file) {
|
|
||||||
include $file;
|
|
||||||
}, null, null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
44
vendor/composer/InstalledVersions.php
vendored
44
vendor/composer/InstalledVersions.php
vendored
@ -20,27 +20,12 @@ use Composer\Semver\VersionParser;
|
|||||||
*
|
*
|
||||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||||
*
|
*
|
||||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
* To require it's presence, you can require `composer-runtime-api ^2.0`
|
||||||
*
|
|
||||||
* @final
|
|
||||||
*/
|
*/
|
||||||
class InstalledVersions
|
class InstalledVersions
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @var mixed[]|null
|
|
||||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
|
||||||
*/
|
|
||||||
private static $installed;
|
private static $installed;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool|null
|
|
||||||
*/
|
|
||||||
private static $canGetVendors;
|
private static $canGetVendors;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array[]
|
|
||||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
|
||||||
*/
|
|
||||||
private static $installedByVendor = array();
|
private static $installedByVendor = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -98,7 +83,7 @@ class InstalledVersions
|
|||||||
{
|
{
|
||||||
foreach (self::getInstalled() as $installed) {
|
foreach (self::getInstalled() as $installed) {
|
||||||
if (isset($installed['versions'][$packageName])) {
|
if (isset($installed['versions'][$packageName])) {
|
||||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +104,7 @@ class InstalledVersions
|
|||||||
*/
|
*/
|
||||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||||
{
|
{
|
||||||
$constraint = $parser->parseConstraints((string) $constraint);
|
$constraint = $parser->parseConstraints($constraint);
|
||||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||||
|
|
||||||
return $provided->matches($constraint);
|
return $provided->matches($constraint);
|
||||||
@ -243,7 +228,7 @@ class InstalledVersions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
|
||||||
*/
|
*/
|
||||||
public static function getRootPackage()
|
public static function getRootPackage()
|
||||||
{
|
{
|
||||||
@ -257,7 +242,7 @@ class InstalledVersions
|
|||||||
*
|
*
|
||||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||||
* @return array[]
|
* @return array[]
|
||||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
|
||||||
*/
|
*/
|
||||||
public static function getRawData()
|
public static function getRawData()
|
||||||
{
|
{
|
||||||
@ -280,7 +265,7 @@ class InstalledVersions
|
|||||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||||
*
|
*
|
||||||
* @return array[]
|
* @return array[]
|
||||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
|
||||||
*/
|
*/
|
||||||
public static function getAllRawData()
|
public static function getAllRawData()
|
||||||
{
|
{
|
||||||
@ -303,7 +288,7 @@ class InstalledVersions
|
|||||||
* @param array[] $data A vendor/composer/installed.php data set
|
* @param array[] $data A vendor/composer/installed.php data set
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
|
||||||
*/
|
*/
|
||||||
public static function reload($data)
|
public static function reload($data)
|
||||||
{
|
{
|
||||||
@ -313,7 +298,7 @@ class InstalledVersions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array[]
|
* @return array[]
|
||||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
|
||||||
*/
|
*/
|
||||||
private static function getInstalled()
|
private static function getInstalled()
|
||||||
{
|
{
|
||||||
@ -328,9 +313,7 @@ class InstalledVersions
|
|||||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||||
$installed[] = self::$installedByVendor[$vendorDir];
|
$installed[] = self::$installedByVendor[$vendorDir];
|
||||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||||
$required = require $vendorDir.'/composer/installed.php';
|
|
||||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
|
||||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||||
self::$installed = $installed[count($installed) - 1];
|
self::$installed = $installed[count($installed) - 1];
|
||||||
}
|
}
|
||||||
@ -342,17 +325,12 @@ class InstalledVersions
|
|||||||
// only require the installed.php file if this file is loaded from its dumped location,
|
// only require the installed.php file if this file is loaded from its dumped location,
|
||||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
self::$installed = require __DIR__ . '/installed.php';
|
||||||
$required = require __DIR__ . '/installed.php';
|
|
||||||
self::$installed = $required;
|
|
||||||
} else {
|
} else {
|
||||||
self::$installed = array();
|
self::$installed = array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$installed[] = self::$installed;
|
||||||
if (self::$installed !== array()) {
|
|
||||||
$installed[] = self::$installed;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $installed;
|
return $installed;
|
||||||
}
|
}
|
||||||
|
|||||||
2
vendor/composer/autoload_classmap.php
vendored
2
vendor/composer/autoload_classmap.php
vendored
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_classmap.php @generated by Composer
|
// autoload_classmap.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(__DIR__);
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|||||||
2
vendor/composer/autoload_files.php
vendored
2
vendor/composer/autoload_files.php
vendored
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_files.php @generated by Composer
|
// autoload_files.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(__DIR__);
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|||||||
2
vendor/composer/autoload_namespaces.php
vendored
2
vendor/composer/autoload_namespaces.php
vendored
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_namespaces.php @generated by Composer
|
// autoload_namespaces.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(__DIR__);
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|||||||
4
vendor/composer/autoload_psr4.php
vendored
4
vendor/composer/autoload_psr4.php
vendored
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
// autoload_psr4.php @generated by Composer
|
// autoload_psr4.php @generated by Composer
|
||||||
|
|
||||||
$vendorDir = dirname(__DIR__);
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'WPHelper\\' => array($vendorDir . '/abuyoyo/adminmenupage/src', $vendorDir . '/abuyoyo/metabox', $vendorDir . '/abuyoyo/plugincore'),
|
'WPHelper\\' => array($vendorDir . '/abuyoyo/adminmenupage/src', $vendorDir . '/abuyoyo/plugincore'),
|
||||||
);
|
);
|
||||||
|
|||||||
57
vendor/composer/autoload_real.php
vendored
57
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_real.php @generated by Composer
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
class ComposerAutoloaderInita13a895834453aad32a897cc456c73ff
|
class ComposerAutoloaderInit99e41faf4c8cd1b54927a50ca0e7ee5c
|
||||||
{
|
{
|
||||||
private static $loader;
|
private static $loader;
|
||||||
|
|
||||||
@ -22,27 +22,52 @@ class ComposerAutoloaderInita13a895834453aad32a897cc456c73ff
|
|||||||
return self::$loader;
|
return self::$loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInita13a895834453aad32a897cc456c73ff', 'loadClassLoader'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInit99e41faf4c8cd1b54927a50ca0e7ee5c', 'loadClassLoader'), true, true);
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInita13a895834453aad32a897cc456c73ff', 'loadClassLoader'));
|
spl_autoload_unregister(array('ComposerAutoloaderInit99e41faf4c8cd1b54927a50ca0e7ee5c', 'loadClassLoader'));
|
||||||
|
|
||||||
require __DIR__ . '/autoload_static.php';
|
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||||
call_user_func(\Composer\Autoload\ComposerStaticInita13a895834453aad32a897cc456c73ff::getInitializer($loader));
|
if ($useStaticLoader) {
|
||||||
|
require __DIR__ . '/autoload_static.php';
|
||||||
|
|
||||||
|
call_user_func(\Composer\Autoload\ComposerStaticInit99e41faf4c8cd1b54927a50ca0e7ee5c::getInitializer($loader));
|
||||||
|
} else {
|
||||||
|
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||||
|
foreach ($map as $namespace => $path) {
|
||||||
|
$loader->set($namespace, $path);
|
||||||
|
}
|
||||||
|
|
||||||
|
$map = require __DIR__ . '/autoload_psr4.php';
|
||||||
|
foreach ($map as $namespace => $path) {
|
||||||
|
$loader->setPsr4($namespace, $path);
|
||||||
|
}
|
||||||
|
|
||||||
|
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||||
|
if ($classMap) {
|
||||||
|
$loader->addClassMap($classMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
$filesToLoad = \Composer\Autoload\ComposerStaticInita13a895834453aad32a897cc456c73ff::$files;
|
if ($useStaticLoader) {
|
||||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
$includeFiles = Composer\Autoload\ComposerStaticInit99e41faf4c8cd1b54927a50ca0e7ee5c::$files;
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
} else {
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||||
|
}
|
||||||
require $file;
|
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||||
}
|
composerRequire99e41faf4c8cd1b54927a50ca0e7ee5c($fileIdentifier, $file);
|
||||||
}, null, null);
|
|
||||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
|
||||||
$requireFile($fileIdentifier, $file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $loader;
|
return $loader;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function composerRequire99e41faf4c8cd1b54927a50ca0e7ee5c($fileIdentifier, $file)
|
||||||
|
{
|
||||||
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
|
require $file;
|
||||||
|
|
||||||
|
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
11
vendor/composer/autoload_static.php
vendored
11
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace Composer\Autoload;
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
class ComposerStaticInita13a895834453aad32a897cc456c73ff
|
class ComposerStaticInit99e41faf4c8cd1b54927a50ca0e7ee5c
|
||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'8653524d908cf23a56335c6d210d6627' => __DIR__ . '/..' . '/abuyoyo/adminmenupage/wph_admin_page.php',
|
'8653524d908cf23a56335c6d210d6627' => __DIR__ . '/..' . '/abuyoyo/adminmenupage/wph_admin_page.php',
|
||||||
@ -22,8 +22,7 @@ class ComposerStaticInita13a895834453aad32a897cc456c73ff
|
|||||||
'WPHelper\\' =>
|
'WPHelper\\' =>
|
||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/abuyoyo/adminmenupage/src',
|
0 => __DIR__ . '/..' . '/abuyoyo/adminmenupage/src',
|
||||||
1 => __DIR__ . '/..' . '/abuyoyo/metabox',
|
1 => __DIR__ . '/..' . '/abuyoyo/plugincore',
|
||||||
2 => __DIR__ . '/..' . '/abuyoyo/plugincore',
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -34,9 +33,9 @@ class ComposerStaticInita13a895834453aad32a897cc456c73ff
|
|||||||
public static function getInitializer(ClassLoader $loader)
|
public static function getInitializer(ClassLoader $loader)
|
||||||
{
|
{
|
||||||
return \Closure::bind(function () use ($loader) {
|
return \Closure::bind(function () use ($loader) {
|
||||||
$loader->prefixLengthsPsr4 = ComposerStaticInita13a895834453aad32a897cc456c73ff::$prefixLengthsPsr4;
|
$loader->prefixLengthsPsr4 = ComposerStaticInit99e41faf4c8cd1b54927a50ca0e7ee5c::$prefixLengthsPsr4;
|
||||||
$loader->prefixDirsPsr4 = ComposerStaticInita13a895834453aad32a897cc456c73ff::$prefixDirsPsr4;
|
$loader->prefixDirsPsr4 = ComposerStaticInit99e41faf4c8cd1b54927a50ca0e7ee5c::$prefixDirsPsr4;
|
||||||
$loader->classMap = ComposerStaticInita13a895834453aad32a897cc456c73ff::$classMap;
|
$loader->classMap = ComposerStaticInit99e41faf4c8cd1b54927a50ca0e7ee5c::$classMap;
|
||||||
|
|
||||||
}, null, ClassLoader::class);
|
}, null, ClassLoader::class);
|
||||||
}
|
}
|
||||||
|
|||||||
85
vendor/composer/installed.json
vendored
85
vendor/composer/installed.json
vendored
@ -2,27 +2,24 @@
|
|||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "abuyoyo/adminmenupage",
|
"name": "abuyoyo/adminmenupage",
|
||||||
"version": "0.29",
|
"version": "0.21",
|
||||||
"version_normalized": "0.29.0.0",
|
"version_normalized": "0.21.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/abuyoyo/AdminMenuPage.git",
|
"url": "https://github.com/abuyoyo/AdminMenuPage.git",
|
||||||
"reference": "4cd47d5217ca25ed17af76f5fdbab3cab3b37ef8"
|
"reference": "d05a9e9977d7e7c4ba3c913993493fefba4359d6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/abuyoyo/AdminMenuPage/zipball/4cd47d5217ca25ed17af76f5fdbab3cab3b37ef8",
|
"url": "https://api.github.com/repos/abuyoyo/AdminMenuPage/zipball/d05a9e9977d7e7c4ba3c913993493fefba4359d6",
|
||||||
"reference": "4cd47d5217ca25ed17af76f5fdbab3cab3b37ef8",
|
"reference": "d05a9e9977d7e7c4ba3c913993493fefba4359d6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
|
||||||
"abuyoyo/metabox": "~0.8"
|
|
||||||
},
|
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"abuyoyo/plugincore": "~0.26",
|
"abuyoyo/plugincore": "~0.18",
|
||||||
"cmb2/cmb2": "~2.9"
|
"cmb2/cmb2": "~2.9"
|
||||||
},
|
},
|
||||||
"time": "2023-10-05T00:00:00+00:00",
|
"time": "2022-08-06T13:42:37+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -40,64 +37,30 @@
|
|||||||
"description": "WordPress admin menu page helper class",
|
"description": "WordPress admin menu page helper class",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/abuyoyo/AdminMenuPage/issues",
|
"issues": "https://github.com/abuyoyo/AdminMenuPage/issues",
|
||||||
"source": "https://github.com/abuyoyo/AdminMenuPage/tree/0.29"
|
"source": "https://github.com/abuyoyo/AdminMenuPage/tree/0.21"
|
||||||
},
|
},
|
||||||
"install-path": "../abuyoyo/adminmenupage"
|
"install-path": "../abuyoyo/adminmenupage"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "abuyoyo/metabox",
|
|
||||||
"version": "0.8",
|
|
||||||
"version_normalized": "0.8.0.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/abuyoyo/MetaBox.git",
|
|
||||||
"reference": "98cb4c30db4c366c0d273985eb9c31ffa1cd78f9"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/abuyoyo/MetaBox/zipball/98cb4c30db4c366c0d273985eb9c31ffa1cd78f9",
|
|
||||||
"reference": "98cb4c30db4c366c0d273985eb9c31ffa1cd78f9",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"time": "2023-07-18T19:14:03+00:00",
|
|
||||||
"type": "library",
|
|
||||||
"installation-source": "dist",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"WPHelper\\": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"description": "WordPress metabox helper class",
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/abuyoyo/MetaBox/issues",
|
|
||||||
"source": "https://github.com/abuyoyo/MetaBox/tree/0.8"
|
|
||||||
},
|
|
||||||
"install-path": "../abuyoyo/metabox"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "abuyoyo/plugincore",
|
"name": "abuyoyo/plugincore",
|
||||||
"version": "0.27",
|
"version": "0.23",
|
||||||
"version_normalized": "0.27.0.0",
|
"version_normalized": "0.23.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/abuyoyo/PluginCore.git",
|
"url": "https://github.com/abuyoyo/PluginCore.git",
|
||||||
"reference": "d730a674cbe2dc92e60ace8e25a2e0e3fdeee3e6"
|
"reference": "0a5809d6722a2abf0bdaf23f73bd3875b00fd2a4"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/abuyoyo/PluginCore/zipball/d730a674cbe2dc92e60ace8e25a2e0e3fdeee3e6",
|
"url": "https://api.github.com/repos/abuyoyo/PluginCore/zipball/0a5809d6722a2abf0bdaf23f73bd3875b00fd2a4",
|
||||||
"reference": "d730a674cbe2dc92e60ace8e25a2e0e3fdeee3e6",
|
"reference": "0a5809d6722a2abf0bdaf23f73bd3875b00fd2a4",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"abuyoyo/adminmenupage": "~0.27",
|
"abuyoyo/adminmenupage": "~0.20",
|
||||||
"yahnis-elsts/plugin-update-checker": "~5.2"
|
"yahnis-elsts/plugin-update-checker": "~4.12"
|
||||||
},
|
},
|
||||||
"time": "2022-10-03T00:00:00+00:00",
|
"time": "2022-08-06T00:00:00+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -112,26 +75,26 @@
|
|||||||
"description": "WordPress plugin core helper class",
|
"description": "WordPress plugin core helper class",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/abuyoyo/PluginCore/issues",
|
"issues": "https://github.com/abuyoyo/PluginCore/issues",
|
||||||
"source": "https://github.com/abuyoyo/PluginCore/tree/0.27"
|
"source": "https://github.com/abuyoyo/PluginCore/tree/0.23"
|
||||||
},
|
},
|
||||||
"install-path": "../abuyoyo/plugincore"
|
"install-path": "../abuyoyo/plugincore"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "abuyoyo/screen-meta-links",
|
"name": "abuyoyo/screen-meta-links",
|
||||||
"version": "0.13",
|
"version": "0.11",
|
||||||
"version_normalized": "0.13.0.0",
|
"version_normalized": "0.11.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/abuyoyo/screen-meta-links.git",
|
"url": "https://github.com/abuyoyo/screen-meta-links.git",
|
||||||
"reference": "b324cef9eb5825d04ffa17f771237b7deca5cd01"
|
"reference": "04e3c892f0c6095b4c31a489e06336f0917128d3"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/abuyoyo/screen-meta-links/zipball/b324cef9eb5825d04ffa17f771237b7deca5cd01",
|
"url": "https://api.github.com/repos/abuyoyo/screen-meta-links/zipball/04e3c892f0c6095b4c31a489e06336f0917128d3",
|
||||||
"reference": "b324cef9eb5825d04ffa17f771237b7deca5cd01",
|
"reference": "04e3c892f0c6095b4c31a489e06336f0917128d3",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"time": "2023-08-08T22:37:03+00:00",
|
"time": "2022-05-18T01:18:24+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -141,7 +104,7 @@
|
|||||||
},
|
},
|
||||||
"description": "API for adding custom screen-meta-links alongside the 'Screen Options' and 'Help' links.",
|
"description": "API for adding custom screen-meta-links alongside the 'Screen Options' and 'Help' links.",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/abuyoyo/screen-meta-links/tree/0.13",
|
"source": "https://github.com/abuyoyo/screen-meta-links/tree/0.11",
|
||||||
"issues": "https://github.com/abuyoyo/screen-meta-links/issues"
|
"issues": "https://github.com/abuyoyo/screen-meta-links/issues"
|
||||||
},
|
},
|
||||||
"install-path": "../abuyoyo/screen-meta-links"
|
"install-path": "../abuyoyo/screen-meta-links"
|
||||||
|
|||||||
41
vendor/composer/installed.php
vendored
41
vendor/composer/installed.php
vendored
@ -1,58 +1,49 @@
|
|||||||
<?php return array(
|
<?php return array(
|
||||||
'root' => array(
|
'root' => array(
|
||||||
'name' => 'abuyoyo/notice-manager',
|
'pretty_version' => '0.18',
|
||||||
'pretty_version' => '0.25',
|
'version' => '0.18.0.0',
|
||||||
'version' => '0.25.0.0',
|
|
||||||
'reference' => NULL,
|
|
||||||
'type' => 'wordpress-plugin',
|
'type' => 'wordpress-plugin',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
'reference' => NULL,
|
||||||
|
'name' => 'abuyoyo/notice-manager',
|
||||||
'dev' => true,
|
'dev' => true,
|
||||||
),
|
),
|
||||||
'versions' => array(
|
'versions' => array(
|
||||||
'abuyoyo/adminmenupage' => array(
|
'abuyoyo/adminmenupage' => array(
|
||||||
'pretty_version' => '0.29',
|
'pretty_version' => '0.21',
|
||||||
'version' => '0.29.0.0',
|
'version' => '0.21.0.0',
|
||||||
'reference' => '4cd47d5217ca25ed17af76f5fdbab3cab3b37ef8',
|
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../abuyoyo/adminmenupage',
|
'install_path' => __DIR__ . '/../abuyoyo/adminmenupage',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'reference' => 'd05a9e9977d7e7c4ba3c913993493fefba4359d6',
|
||||||
),
|
|
||||||
'abuyoyo/metabox' => array(
|
|
||||||
'pretty_version' => '0.8',
|
|
||||||
'version' => '0.8.0.0',
|
|
||||||
'reference' => '98cb4c30db4c366c0d273985eb9c31ffa1cd78f9',
|
|
||||||
'type' => 'library',
|
|
||||||
'install_path' => __DIR__ . '/../abuyoyo/metabox',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'abuyoyo/notice-manager' => array(
|
'abuyoyo/notice-manager' => array(
|
||||||
'pretty_version' => '0.25',
|
'pretty_version' => '0.18',
|
||||||
'version' => '0.25.0.0',
|
'version' => '0.18.0.0',
|
||||||
'reference' => NULL,
|
|
||||||
'type' => 'wordpress-plugin',
|
'type' => 'wordpress-plugin',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
'reference' => NULL,
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'abuyoyo/plugincore' => array(
|
'abuyoyo/plugincore' => array(
|
||||||
'pretty_version' => '0.27',
|
'pretty_version' => '0.23',
|
||||||
'version' => '0.27.0.0',
|
'version' => '0.23.0.0',
|
||||||
'reference' => 'd730a674cbe2dc92e60ace8e25a2e0e3fdeee3e6',
|
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../abuyoyo/plugincore',
|
'install_path' => __DIR__ . '/../abuyoyo/plugincore',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
'reference' => '0a5809d6722a2abf0bdaf23f73bd3875b00fd2a4',
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'abuyoyo/screen-meta-links' => array(
|
'abuyoyo/screen-meta-links' => array(
|
||||||
'pretty_version' => '0.13',
|
'pretty_version' => '0.11',
|
||||||
'version' => '0.13.0.0',
|
'version' => '0.11.0.0',
|
||||||
'reference' => 'b324cef9eb5825d04ffa17f771237b7deca5cd01',
|
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../abuyoyo/screen-meta-links',
|
'install_path' => __DIR__ . '/../abuyoyo/screen-meta-links',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
'reference' => '04e3c892f0c6095b4c31a489e06336f0917128d3',
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user