Compare commits

...

25 Commits

Author SHA1 Message Date
1b65c0624a some texton building with drone
Some checks failed
continuous-integration/drone/push Build is failing
2025-01-30 10:41:29 +01:00
4e34e68dae introducing portfolio single 2025-01-30 10:41:15 +01:00
68d2281bd8 base styling 2025-01-30 10:40:57 +01:00
5261e1aea8 refactoring 2025-01-30 10:40:51 +01:00
aef25d14f5 introducing specific styles propper to editor 2025-01-30 10:40:41 +01:00
46284d8e07 declaring custom taxonomies 2025-01-30 10:40:13 +01:00
8ed300f823 bundling 2025-01-30 10:40:02 +01:00
ecb134f893 renaming base css by base style previous theme 2025-01-30 10:39:55 +01:00
05481f49d5 refactoring init function 2025-01-30 10:39:13 +01:00
6cee8f859a replacing font links on header by this @import from external apis 2025-01-30 10:38:59 +01:00
643180e9f7 some styling for the single porfolio page 2025-01-30 10:38:33 +01:00
111295602f working on portfolio template 2025-01-30 10:38:19 +01:00
5b39b0f8b1 working on block styles 2025-01-30 10:38:01 +01:00
cb591334a4 tweaking post type portfolio 2025-01-30 10:37:43 +01:00
a384bb2e0c bundling files 2025-01-30 10:37:28 +01:00
3d4f35d451 init composer 2025-01-30 10:36:59 +01:00
a72bdc6252 installing composer post type helper 2025-01-30 10:36:27 +01:00
3616f8c5b3 tailpress install 2025-01-30 10:22:17 +01:00
956bb45f99 add production package build 2025-01-30 10:22:07 +01:00
00ffb18e21 init pnpm 2025-01-30 10:21:57 +01:00
d3d989c6ef tailpress install 2025-01-30 10:21:45 +01:00
c6314b89f5 initialising composer 2025-01-30 10:21:18 +01:00
304c11e83e removing package lock 2025-01-30 10:21:00 +01:00
ebc0ae0c5a removing old drone files 2025-01-30 10:20:49 +01:00
7cb14a42af comment enqueing assets and enqueing assets in the init function 2025-01-30 10:20:29 +01:00
134 changed files with 20458 additions and 8410 deletions

View File

@ -3,11 +3,20 @@ type: docker
name: default
steps:
- name: test
- name: Clonage du Repo
image: alpine
commands:
- pwd
- ls
- git clone https://git.deligraph.be/Antoine/Deligraph-V3
- name: Installation du package
image: alpine
commands:
- cd homegrade_theme_production
- npm install
- name: Build du package
image: alpine
commands:
- cd Deligraph-V3
- npm run production
- name: Deploy to FTP server
image: cschlosser/drone-ftps

View File

@ -1,37 +0,0 @@
---
kind: pipeline
type: ssh
name: Homegrade | Déploiment du Thème
clone:
disable: true
server:
host:
from_secret: build_server_host
user:
from_secret: build_server_user
password:
from_secret: build_server_password
steps:
- name: Clonage du Repo
commands:
- git clone https://git.deligraph.be/Antoine/homegrade_theme_production.git
- name: Installation du package
commands:
- cd homegrade_theme_production
- npm install
- name: Build du package
commands:
- cd homegrade_theme_production
- npm run production
- name: deploy-via-sftp
image: appleboy/drone-scp
settings:
host: sftp.your-server.com
username: your-username
password: your-password # Utiliser une variable d'environnement pour plus de sécurité
port: 22
target: /test/
source: ./build/* # Répertoire source avec les fichiers à déployer

View File

@ -1,23 +0,0 @@
name: Docker Image
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: cschlosser/drone-ftps

5
composer.json Normal file
View File

@ -0,0 +1,5 @@
{
"require": {
"johnbillion/extended-cpts": "^5.0"
}
}

195
composer.lock generated Normal file
View File

@ -0,0 +1,195 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5d11d49c79c69e1eb2b4fdc8d844777a",
"packages": [
{
"name": "johnbillion/args",
"version": "1.10.0",
"source": {
"type": "git",
"url": "https://github.com/johnbillion/args.git",
"reference": "ef670a14ce0b9221cee0a39f076f4810a200d1ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/johnbillion/args/zipball/ef670a14ce0b9221cee0a39f076f4810a200d1ac",
"reference": "ef670a14ce0b9221cee0a39f076f4810a200d1ac",
"shasum": ""
},
"require": {
"php": ">=7.4"
},
"require-dev": {
"ergebnis/json-printer": "^3.2",
"ergebnis/phpstan-rules": "^1.0",
"humanmade/coding-standards": "^1.1",
"johnbillion/falsey-assertequals-detector": "^3",
"phpdocumentor/reflection": "~4.0 || ~5.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.1",
"phpunit/phpunit": "^9.0",
"roots/wordpress-core-installer": "^1.0.0",
"roots/wordpress-full": "~6.5.0"
},
"type": "library",
"extra": {
"args-shapes": [
"--function=\"\\get_categories()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category.php",
"--function=\"\\get_comments()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/comment.php",
"--function=\"\\get_posts()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\get_tags()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category.php",
"--function=\"\\get_terms()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\get_users()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/user.php",
"--function=\"\\paginate_links()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/general-template.php",
"--function=\"\\register_block_type()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/blocks.php",
"--function=\"\\register_meta()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/meta.php",
"--function=\"\\register_post_meta()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\register_post_status()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\register_post_type()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\register_rest_field()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/rest-api.php",
"--function=\"\\register_taxonomy()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\register_term_meta()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_count_terms()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_die()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/functions.php",
"--function=\"\\wp_dropdown_categories()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category-template.php",
"--function=\"\\wp_dropdown_languages()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/l10n.php",
"--function=\"\\wp_generate_tag_cloud()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category-template.php",
"--function=\"\\wp_get_nav_menus()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/nav-menu.php",
"--function=\"\\wp_get_object_terms()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_insert_post()\" --param=postarr --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\wp_insert_term()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_insert_user()\" --param=userdata --file=vendor/wordpress/wordpress/wp-includes/user.php",
"--function=\"\\wp_nav_menu()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/nav-menu-template.php",
"--function=\"\\wp_remote_get()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_remote_head()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_remote_post()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_remote_request()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_get()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_head()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_post()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_request()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_update_post()\" --param=postarr --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\wp_update_term()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_update_user()\" --param=userdata --file=vendor/wordpress/wordpress/wp-includes/user.php",
"--method=\"\\WP_Block_Type::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-block-type.php",
"--method=\"\\WP_Comment_Query::__construct()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-comment-query.php",
"--method=\"\\WP_Customize_Control::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-control.php",
"--method=\"\\WP_Customize_Manager::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-manager.php",
"--method=\"\\WP_Customize_Panel::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-panel.php",
"--method=\"\\WP_Customize_Section::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-section.php",
"--method=\"\\WP_Customize_Setting::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-setting.php",
"--method=\"\\WP_Http::request()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-http.php",
"--method=\"\\WP_Query::parse_query()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-query.php",
"--method=\"\\WP_Term_Query::__construct()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-term-query.php",
"--method=\"\\WP_User_Query::prepare_query()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-user-query.php"
],
"wordpress-install-dir": "vendor/wordpress/wordpress"
},
"autoload": {
"psr-4": {
"Args\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "John Blackbourn",
"homepage": "https://johnblackbourn.com/"
}
],
"description": "I don't want to get into an argument about this.",
"support": {
"issues": "https://github.com/johnbillion/args/issues",
"source": "https://github.com/johnbillion/args/tree/1.10.0"
},
"funding": [
{
"url": "https://github.com/sponsors/johnbillion",
"type": "github"
}
],
"time": "2024-04-02T21:50:24+00:00"
},
{
"name": "johnbillion/extended-cpts",
"version": "5.0.11",
"source": {
"type": "git",
"url": "https://github.com/johnbillion/extended-cpts.git",
"reference": "57f2e74155a12e7a37d07250e6739dbab5a732b3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/johnbillion/extended-cpts/zipball/57f2e74155a12e7a37d07250e6739dbab5a732b3",
"reference": "57f2e74155a12e7a37d07250e6739dbab5a732b3",
"shasum": ""
},
"require": {
"johnbillion/args": "^1.4.1 || ^2.0",
"php": ">= 7.4.0"
},
"require-dev": {
"automattic/phpcs-neutron-standard": "1.7.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"johnbillion/falsey-assertequals-detector": "*",
"johnbillion/plugin-infrastructure": "dev-trunk",
"johnbillion/wp-compat": "0.3.1",
"lucatume/wp-browser": "3.2.3",
"phpcompatibility/phpcompatibility-wp": "2.1.5",
"phpstan/phpstan": "1.12.12",
"phpstan/phpstan-phpunit": "1.4.1",
"roots/wordpress-core-installer": "1.100.0",
"roots/wordpress-full": "*",
"szepeviktor/phpstan-wordpress": "1.3.5",
"wp-coding-standards/wpcs": "2.3.0"
},
"type": "library",
"extra": {
"wordpress-install-dir": "vendor/wordpress/wordpress"
},
"autoload": {
"files": [
"functions.php"
],
"psr-4": {
"ExtCPTs\\": "src",
"ExtCPTs\\Tests\\": "tests/integration"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "John Blackbourn",
"homepage": "https://johnblackbourn.com/"
}
],
"description": "A library which provides extended functionality to WordPress custom post types and taxonomies.",
"homepage": "https://github.com/johnbillion/extended-cpts/",
"support": {
"issues": "https://github.com/johnbillion/extended-cpts/issues",
"source": "https://github.com/johnbillion/extended-cpts/tree/5.0.11"
},
"time": "2024-11-30T23:16:17+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.3.0"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6,15 +6,17 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="profile" href="https://gmpg.org/xfn/11" />
<?php wp_head(); ?>
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/assets/bootstrap/bootstrap.min.css">
<!-- <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/assets/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/assets/slick/slick.css">
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/assets/slick/slick-theme.css">
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/style.css">
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/assets/slick/slickmodal.css">
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/assets/snackbar/snackbar.css">
<script src="https://kit.fontawesome.com/c5f6836d82.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://use.typekit.net/iaa6iur.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat:200,300,400,500,600,700,800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/assets/snackbar/snackbar.css"> -->
<!-- online scripts -->
<!-- <script src="https://kit.fontawesome.com/c5f6836d82.js" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css?family=Montserrat:200,300,400,500,600,700,800&display=swap" rel="stylesheet"> -->
<!-- <link rel="stylesheet" href="https://use.typekit.net/iaa6iur.css"> -->
</head>
<body <?php body_class(); ?>>
@ -36,6 +38,8 @@
<!-- / Your popup content -->
</div>
</div>
<div id="page" class="site">
<div id="content" class="site-content">
<svg class="traceD" xmlns="http://www.w3.org/2000/svg" width="603.108" height="731.346" viewBox="0 0 603.108 731.346">

View File

@ -3,14 +3,37 @@
/**
** activation theme
**/
add_action('wp_enqueue_scripts', 'theme_enqueue_styles');
function theme_enqueue_styles()
{
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
wp_enqueue_style('app-css', get_stylesheet_directory_uri() . '/css/app.css');
wp_enqueue_script('jquery_min_script', get_stylesheet_directory_uri() . '/assets/jquery.js');
wp_enqueue_style('original-previous-css', get_stylesheet_directory_uri() . '/css/base-styles-previous-theme.css');
}
function theme_enqueue_librairies()
{
wp_enqueue_script('jquery_min_script', get_stylesheet_directory_uri() . '/assets/jquery.js');
wp_enqueue_style('bootstrap', get_stylesheet_directory_uri() . '/assets/bootstrap/bootstrap.min.css"');
wp_enqueue_style('slick', get_stylesheet_directory_uri() . '/assets/slick/slick.css');
wp_enqueue_style('slick-theme', get_stylesheet_directory_uri() . '/assets/slick/slick-theme.css');
wp_enqueue_style('slick-modal', get_stylesheet_directory_uri() . '/assets/slick/slickmodal.css');
wp_enqueue_style('slick-modal', get_stylesheet_directory_uri() . '/assets/snackbar/snackbar.css');
}
add_action('wp_enqueue_scripts', 'theme_enqueue_styles');
add_action('wp_enqueue_scripts', 'theme_enqueue_librairies');
function theme_enqueue_styles_back()
{
wp_enqueue_style('app-css', get_stylesheet_directory_uri() . '/css/app.css');
wp_enqueue_style('original-previous-css', get_stylesheet_directory_uri() . '/css/base-styles-previous-theme.css');
}
add_action('enqueue_block_editor_assets', 'theme_enqueue_styles_back');
/* Image mise à la une*/
function my_login_logo_url()
@ -104,12 +127,6 @@ function custom_pagination($numpages = '', $pagerange = '', $paged = '')
/* ---- SHORTCODE ---- */
function shortcode_col($atts, $content)
@ -140,4 +157,18 @@ function register_my_menu()
register_nav_menu('MegaMenu', __('MegaMenu'));
}
add_action('init', 'register_my_menu');
/* ------------------------------
ENABLE SVG
------------------------------*/
function cc_mime_types($mimes)
{
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');
?>

View File

@ -32,8 +32,14 @@ function cpt_customer()
'menu_icon' => 'dashicons-forms',
'show_ui' => true,
'hierarchical' => false,
'supports' => array('title', 'thumbnail')
'supports' => array('title', 'thumbnail', 'editor', 'excerpt', 'custom-fields', 'revisions', 'page-attributes'),
'show_in_rest' => true, // Active l'éditeur de blocs (Gutenberg).
)
);
}
add_action('init', 'cpt_customer');
function my_custom_post_type() {}
add_action('init', 'my_custom_post_type');

View File

@ -1,26 +1,66 @@
<?php
// Catégories custom post type
register_taxonomy(
'customer', /* Voici donc la taxonomie */
array('customer'), /* nom du custom post type */
array(
'hierarchical' => true,
// ######################@
/* -------------------
REGISTER TAXONOMIES
--------------------*/
function homegrade_add_custom_taxonomies()
{
// ————— Thématiques —————
register_taxonomy('project_type', ['portfolio'], array(
// 'hierarchical' => true,
'labels' => array(
'name' => __('Catégories', 'customer'),
'singular_name' => __('Catégories', 'nom du theme'),
'search_items' => __('Rechercher une catégorie', 'nom du theme'),
'all_items' => __('Toutes les catégories', 'nom du theme'),
'parent_item' => __('Catégorie parente', 'nom du theme'),
'parent_item_colon' => __('Catégorie parente :', 'nom du theme'),
'edit_item' => __('Éditer une catégorie', 'nom du theme'),
'update_item' => __('Sauvegarder une catégorie', 'nom du theme'),
'add_new_item' => __('Ajouter une catégorie', 'nom du theme'),
'new_item_name' => __('Nouvelle catégorie', 'nom du theme')
'name' => __('Type de projet', 'deligraph-theme'),
'singular_name' => __('Type de projet', 'deligraph-theme'),
'search_items' => __('Chercher un type de projet', 'deligraph-theme'),
'all_items' => __('Touts les Types de projet', 'deligraph-theme'),
'parent_item' => __('Type de projet Parent', 'deligraph-theme'),
'parent_item_colon' => __('Type de projet Parent:', 'deligraph-theme'),
'edit_item' => __('Editer le Type de projet', 'deligraph-theme'),
'update_item' => __('Mettre à jour le Type de projet', 'deligraph-theme'),
'add_new_item' => __('Ajouter un Type de projet', 'deligraph-theme'),
'new_item_name' => __('Nom du nouveau Type de projet', 'deligraph-theme'),
'menu_name' => __('Type de projet', 'deligraph-theme'),
),
'show_admin_column' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => array('slug' => 'customer'),
)
);
'public' => true,
'show_in_rest' => true,
'show_ui' => true,
'show_admin_column' => false,
'show_in_quick_edit' => false,
'meta_box_cb' => false,
'hierarchical' => false,
));
register_taxonomy(
'customer', /* Voici donc la taxonomie */
array('customer'), /* nom du custom post type */
array(
'hierarchical' => true,
'labels' => array(
'name' => __('Catégories', 'customer'),
'singular_name' => __('Catégories', 'nom du theme'),
'search_items' => __('Rechercher une catégorie', 'nom du theme'),
'all_items' => __('Toutes les catégories', 'nom du theme'),
'parent_item' => __('Catégorie parente', 'nom du theme'),
'parent_item_colon' => __('Catégorie parente :', 'nom du theme'),
'edit_item' => __('Éditer une catégorie', 'nom du theme'),
'update_item' => __('Sauvegarder une catégorie', 'nom du theme'),
'add_new_item' => __('Ajouter une catégorie', 'nom du theme'),
'new_item_name' => __('Nouvelle catégorie', 'nom du theme')
),
'show_admin_column' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => array('slug' => 'customer'),
)
);
}
add_action('init', 'homegrade_add_custom_taxonomies', 0);

View File

@ -21,9 +21,9 @@
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
};
// node_modules/@popperjs/core/dist/cjs/popper.js
// node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/dist/cjs/popper.js
var require_popper = __commonJS({
"node_modules/@popperjs/core/dist/cjs/popper.js"(exports) {
"node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/dist/cjs/popper.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getWindow(node) {
@ -1366,9 +1366,9 @@
}
});
// node_modules/bootstrap/dist/js/bootstrap.js
// node_modules/.pnpm/bootstrap@5.3.3_@popperjs+core@2.11.8/node_modules/bootstrap/dist/js/bootstrap.js
var require_bootstrap = __commonJS({
"node_modules/bootstrap/dist/js/bootstrap.js"(exports, module) {
"node_modules/.pnpm/bootstrap@5.3.3_@popperjs+core@2.11.8/node_modules/bootstrap/dist/js/bootstrap.js"(exports, module) {
(function(global, factory) {
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory(require_popper()) : typeof define === "function" && define.amd ? define(["@popperjs/core"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, global.bootstrap = factory(global.Popper));
})(exports, function(Popper) {

4312
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,19 +7,22 @@
"description": "",
"scripts": {
"production:css-app": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/app.css -o ./css/app.css --postcss --minify",
"production:previous-css": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/base-styles-previous-theme.css -o ./css/base-styles-previous-theme.css --postcss --minify",
"production:css-editor": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/editor-style.css -o ./css/editor-style.css --postcss --minify",
"production:css-admin": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/admin-style.css -o ./css/admin-style.css --postcss --minify",
"production:js": "cross-env NODE_ENV=development ./node_modules/.bin/esbuild ./resources/js/app.js --bundle --outfile=./js/app.js --minify",
"dev:css-app": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/app.css -o ./css/app.css --postcss",
"dev:previous-css": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/base-styles-previous-theme.css -o ./css/base-styles-previous-theme.css --postcss",
"dev:css-editor": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/editor-style.css -o ./css/editor-style.css --postcss",
"dev:css-admin": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/admin-style.css -o ./css/admin-style.css --postcss",
"dev:css-login": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/login-style.css -o ./css/login-style.css --postcss",
"dev:js": "cross-env NODE_ENV=development ./node_modules/.bin/esbuild ./resources/js/app.js --bundle --outfile=./js/app.js",
"watch:css-app": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/app.css -o ./css/app.css --postcss --watch",
"watch:previous-css": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/base-styles-previous-theme.css -o ./css/base-styles-previous-theme.css --postcss --watch",
"watch:js": "cross-env NODE_ENV=development ./node_modules/.bin/esbuild ./resources/js/app.js --bundle --outfile=./js/app.js --watch",
"production": "cross-env NODE_ENV=production concurrently \"npm run production:css-app\" \"npm run production:js\"",
"dev": "cross-env NODE_ENV=development concurrently \"npm run dev:css-app\" \"npm run dev:js\"",
"watch": "cross-env NODE_ENV=development concurrently \"npm run watch:css-app\" \"npm run watch:js\"",
"production": "cross-env NODE_ENV=production concurrently \"npm run production:css-app\" \"npm run production:previous-css\" \"npm run production:js\"",
"dev": "cross-env NODE_ENV=development concurrently \"npm run dev:css-app\" \"npm run dev:previous-css\" \"npm run dev:js\"",
"watch": "cross-env NODE_ENV=development concurrently \"npm run watch:css-app\" \"npm run watch:previous-css\" \"npm run watch:js\"",
"browser-sync": "cross-env NODE_ENV=development browser-sync start --proxy \"tailpress.test\" --host=\"tailpress.test\" --no-inject-changes --files=\"./\"",
"watch-sync": "cross-env NODE_ENV=development concurrently \"npm run browser-sync\" \"npm run watch\""
},
@ -39,5 +42,6 @@
"dependencies": {
"bootstrap": "^5.3.3",
"esbuild-postcss": "^0.0.4"
}
},
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
}

2428
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,8 @@
module.exports = {
plugins: [require("postcss-nested-ancestors"), require("postcss-import")],
};
plugins: [
require('postcss-nested-ancestors'),
require('postcss-import'),
require('tailwindcss/nesting'),
require('tailwindcss')
]
}

View File

@ -3,7 +3,40 @@
@import "tailwindcss/utilities"; */
/* @import url("css/font.css"); */
@import "./base/font.css";
@import "./base.css";
@import "./editor/editor.css";
@import "./portfolio/single-portfolio.css";
@import "./pages/portfolio.css";
@import "./blocks/portfolio-header.css";
@import "./blocks/gallery-website-screens.css";
@import "./blocks/chapter-section.css";
@import "./blocks/simple-screen.css";
.case-button {
@apply w-fit bg-red-500 px-6 py-2 rounded-full text-white block mt-6;
transition: transform 0.3s ease-in-out;
text-decoration: none !important ;
&:hover {
transform: translateX(2px);
}
}
.project-type {
&--print {
.case-button {
@apply bg-deli-purple;
}
}
&--video,
&--web {
.case-button {
@apply bg-deli-blue !text-white text-sm;
font-family: "Montserrat", sans-serif;
font-weight: 600;
}
}
}
body,
* {

View File

@ -3,6 +3,8 @@
--montserrat: "Montserrat", sans-serif;
--pink: #e91969;
}
* {
margin: 0;
padding: 0;
@ -24,6 +26,9 @@ h1 {
align-content: center;
align-items: center;
}
.alignfull {
margin: 0 calc(50% - 50vw);
}
a,
a:hover,
a:active,

View File

@ -1,19 +1,28 @@
@font-face {
font-family: "montserratblack";
@import url("https://use.typekit.net/iaa6iur.css");
@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");
.bigCaslon {
font-family: "big-caslon-fb", serif;
}
.montserrat {
font-family: "Montserrat", sans-serif;
}
/* @font-face {
font-family: "montserrat";
src: url("../fonts/montserrat-black-webfont.woff2") format("woff2"),
url("../fonts/montserrat-black-webfont.woff") format("woff");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "montserratbold";
font-family: "montserrat";
src: url("../fonts/montserrat-bold-webfont.woff2") format("woff2"),
url("../fonts/montserrat-bold-webfont.woff") format("woff");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "montserratextrabold";
font-family: "montserrat";
src: url("../fonts/montserrat-extrabold-webfont.woff2") format("woff2"),
url("../fonts/montserrat-extrabold-webfont.woff") format("woff");
font-weight: normal;
@ -60,4 +69,4 @@
url("../fonts/montserrat-thin-webfont.woff") format("woff");
font-weight: normal;
font-style: normal;
}
} */

View File

@ -0,0 +1,46 @@
.chapter-section {
@apply flex items-center justify-center 2xl:gap-12 !my-0;
/* min-height: 80vh; */
@apply xl:pt-32;
@apply mx-auto;
& + *:not(.simple-screen) {
@apply xl:mt-32;
}
&--right {
@apply flex-row-reverse;
}
&__content {
flex-shrink: 0;
p {
@apply text-neutral-600;
}
}
&__innerblocks {
@apply max-w-xl;
p {
@apply max-w-md;
}
}
&__cover {
@apply object-contain;
min-width: 0;
flex-shrink: 1;
max-width: 100%; /* Empêche de dépasser son conteneur */
display: block;
&--large {
@apply !h-96;
}
&--grande {
@apply !h-80;
}
&--medium {
@apply !h-64;
}
&--small {
@apply !h-12;
}
}
}

View File

@ -0,0 +1,15 @@
.gallery-website-screens {
@apply bg-neutral-100 p-10 w-screen;
margin: 0 calc(50% - 50vw);
ul {
@apply gap-4 px-0 md:px-4 lg:px-12 justify-center list-none mx-auto;
&.is-grid {
@apply grid grid-cols-2 lg:grid-cols-3;
}
&.is-flex {
@apply flex flex-nowrap;
}
max-width: 1800px;
}
}

View File

@ -0,0 +1,36 @@
.portfolio-header {
@apply p-6 relative !w-screen;
box-sizing: border-box;
margin: 0 calc(50% - 50vw);
max-width: 100vw !important;
dispay: block;
&__cover {
@apply absolute inset-0 bg-red-400 w-full !h-full object-cover;
z-index: -1;
}
&__content {
@apply relative z-10 flex flex-col;
min-height: 80vh;
}
&__project-details {
@apply my-auto text-sm;
}
&__heading-infos {
@apply flex items-center justify-between text-white;
@apply text-xs;
.project-type {
@apply my-0 leading-relaxed;
}
}
.client-logo {
@apply w-72 h-auto object-contain object-center mx-auto block my-12;
}
&__innerblocks {
@apply mx-auto max-w-lg text-white p-8 rounded-lg text-center text-sm;
}
}

View File

@ -0,0 +1,17 @@
.simple-screen {
@apply alignfull my-0;
img {
@apply mx-auto;
}
&--full {
img {
@apply w-full h-auto;
}
}
&--large {
img {
@apply w-full max-w-screen-2xl h-auto;
}
}
}

View File

@ -0,0 +1,10 @@
.wp-admin.post-type-portfolio {
.block-editor-block-list__layout.is-root-container > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
}
.chapter-section {
box-sizing: border-box;
@apply alignfull px-32;
}
}

View File

@ -0,0 +1,5 @@
.project-card {
@apply max-w-screen-2xl mx-auto;
}

View File

@ -0,0 +1,34 @@
.wp-admin.post-type-portfolio .is-root-container,
.portfolio-single {
@apply pt-28 mx-auto;
h1,
h2,
h3,
h4,
h5,
h6 {
@apply bigCaslon;
&:before {
@apply content-none;
}
}
p,
span {
font-family: "Montserrat", sans-serif;
@apply text-sm leading-relaxed;
}
strong {
@apply font-semibold;
}
&__project-infos {
border-bottom: 1px solid #3e3c3c;
@apply flex flex-wrap alignfull list-none;
}
h2 {
@apply text-5xl pb-6;
}
}

8
safelist.txt Normal file
View File

@ -0,0 +1,8 @@
alignfull
alignwide
alignnone
aligncenter
alignright
wp-block-button
wp-caption
wp-caption-text

View File

@ -1,10 +1,18 @@
<?php get_header(); ?>
<div class="container">
<p>salut</p>
<h1>salut</h1>
<h1>salut</h1>
<h1>salut</h1>
<?php
$client = get_field('client_name', get_the_ID());
?>
<div class="portfolio-single ">
<div class="portfolio-single__project-content">
<?php the_content(); ?>
</div>
</div>

37
tailwind.config.js Normal file
View File

@ -0,0 +1,37 @@
const theme = require("./theme.json");
const tailpress = require("@jeffreyvr/tailwindcss-tailpress");
module.exports = {
content: [
"./*.php",
"./**/*.php",
"./resources/css/*.css",
"./resources/js/*.js",
"./safelist.txt",
"!./node_modules/**/*",
],
safelist: [],
theme: {
container: {
padding: {
DEFAULT: "1rem",
sm: "2rem",
lg: "0rem",
},
},
extend: {
colors: tailpress.colorMapper(tailpress.theme("settings.color.palette", theme)),
fontSize: tailpress.fontSizeMapper(tailpress.theme("settings.typography.fontSizes", theme)),
},
screens: {
xs: "480px",
sm: "600px",
md: "782px",
lg: tailpress.theme("settings.layout.contentSize", theme),
xl: tailpress.theme("settings.layout.wideSize", theme),
"2xl": "1440px",
"3xl": "1920px",
},
},
plugins: [tailpress.tailwind],
};

View File

@ -0,0 +1,217 @@
<?php
/*
Template Name: Portfolio
*/
get_header();
?>
<div class="container">
<div class="row">
<div class="col-lg-12 accroche">
<h1><?php echo get_field('nom_de_la_page'); ?></h1>
</div>
<div class="offset-lg-8 col-lg-1">
<div class="circleTop"></div>
</div>
<div class="col-12">
<div class="button-group">
<button class="tout is-checked" data-target="*">tout</button>
<button class="web" data-target=".web">web</button>
<button class="print" data-target=".print">print</button>
<button class="video" data-target=".video">vidéo</button>
<button class="motiondesign" data-target=".motiondesign">motion design</button>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row grid">
<?php
$args = array(
'post_type' => 'portfolio',
'posts_per_page' => -1,
);
$portfolio_post = new WP_Query($args);
?>
<?php if ($portfolio_post->have_posts()) : while ($portfolio_post->have_posts()) : the_post(); ?>
<?php echo get_the_title(); ?>
<?php endwhile; ?>
<?php endif; ?>
<!-- MA CUSTOM -->
<?php
$cat_colors = array(
'web' => '#1CC7C7',
'print' => '#C14FE3',
'motiondesign' => '#21D5F5',
'video' => '#21D5F5',
);
$portfolio_post = get_post(18150);
$projectUrl = get_permalink($portfolio_post);
$thumbnailUrl = get_the_post_thumbnail_url($portfolio_post, 'full');
$mobileThumbnailUrl = get_the_post_thumbnail_url($portfolio_post, 'full');
$projectDescription = get_field('project_description', $portfolio_post);
$pousseBoule = 'offset-lg-8';
$projectType = 'web';
$projectTitle = get_the_title($portfolio_post);
$clientName = get_field('client_name', $portfolio_post);
$currentProjectColor = $cat_colors[$projectType];
$mouse = $categorie === 'video' ? 'Mouseactive' : null;
$i = 3;
$ballOffset = $i === 1 ? 'offset-lg-4' : ($i === 2 ? 'offset-lg-4' : 'offset-lg-8');
?>
<div class="col-12 element-item grid-sizer project-type--<?php echo $projectType; ?> <?php echo $projectType; ?>" data-category="transition">
<div class="row">
<div class="<?php echo $ballOffset; ?> col-lg-1">
<div style="background-color: <?php echo $couleur; ?>" class="circleTop"></div>
</div>
<div class="col-12 <?php
if ($categorie === 'video'):
echo ("openSlickModal-" . $compteurVideo);
endif;
if (empty($lienvideo)) {
echo ' clickno';
}
?>">
<img class="large <?php echo $mouse; ?>" src="<?php echo $thumbnailUrl ?>" alt="alt">
<img class="mobile" src="<?php echo $mobileThumbnailUrl ?>" alt="alt">
</div>
<div style="color: <?php echo $currentProjectColor; ?>" class="col-lg-4 <?php echo $i % 2 == 0 ? '' : 'offset-lg-4' ?> ">
<div style="background-color: <?php echo $currentProjectColor ?>" class="barre"></div>
<h3><?php echo $projectTitle ?></h3>
<p class="client"><?php echo $clientName ?></p>
</div>
<div class="col-lg-4 contenu">
<?php echo $projectDescription ?>
<a class="case-button" href="<?php echo $projectUrl ?>">Lire le Case</a>
</div>
</div>
</div>
<?php
// check if the repeater field has rows of data
$couleur = array(
'web' => '#1CC7C7',
'print' => '#C14FE3',
'motiondesign' => '#21D5F5',
'video' => '#21D5F5',
);
$i = 1;
$compteurBoule = 1;
$compteurVideo = 1;
if (have_rows('portfolio_beta')):
// loop through the rows of data
while (have_rows('portfolio_beta')) : the_row();
$image = get_sub_field('image_du_projet');
$imageMobile = get_sub_field('image_du_projet_mobile');
$categorie = get_sub_field('categorie_du_projet');
$mouse = 'Mousenonactif';
//print_r($categorie);
$valeur = $categorie['value'];
// COMPTEUR BOULE
if ($compteurBoule == 1):
elseif ($compteurBoule == 2):
$pousseBoule = 'offset-lg-4';
elseif ($compteurBoule == 3):
$pousseBoule = 'offset-lg-8';
$compteurBoule = 1;
endif;
// FIN COMPTEUR BOULE
// COMPTEUR VIDEO ET MOUSE VIDEO
if ($categorie['value'] === 'video'):
$mouse = 'Mouseactive';
endif;
// FIN COMPTEUR VIDEO ET FIN MOUSE VIDEO
// LIEN VIDEO VIDE
$lienvideo = get_sub_field('url_de_la_video');
// FIN LIEN VIDEO VIDE
?>
<div class="col-12 element-item grid-sizer <?php echo $categorie['value']; ?>" data-category="transition">
<div class="row">
<div class="<?php echo $pousseBoule; ?> col-lg-1">
<div style="background-color: <?php echo $couleur[$valeur]; ?>" class="circleTop"></div>
</div>
<div class="col-12 <?php
if ($categorie['value'] === 'video'):
echo ("openSlickModal-" . $compteurVideo);
endif;
if (empty($lienvideo)) {
echo ' clickno';
}
?>">
<img class="large <?php echo $mouse; ?>" src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt'] ?>">
<img class="mobile" src="<?php echo $imageMobile['url']; ?>" alt="<?php echo $imageMobile['alt'] ?>">
</div>
<?php
if ($i % 2 == 0):
?>
<div style="color: <?php echo $couleur[$valeur]; ?>" class="col-lg-4">
<div style="background-color: <?php echo $couleur[$valeur]; ?>" class="barre"></div>
<h3><?php echo get_sub_field('nom_du_projet'); ?></h3>
<p class="client"><?php echo get_sub_field('nom_du_client'); ?></p>
</div>
<div class="col-lg-4 contenu"><?php echo get_sub_field('description_du_projet'); ?></div>
<?php
else:
?>
<div style="color: <?php echo $couleur[$valeur]; ?>" class="offset-lg-4 col-lg-4">
<div style="background-color: <?php echo $couleur[$valeur]; ?>" class="barre"></div>
<h3><?php echo get_sub_field('nom_du_projet'); ?></h3>
<p class="client"><?php echo get_sub_field('nom_du_client'); ?></p>
</div>
<div class="col-lg-4 contenu"><?php echo get_sub_field('description_du_projet'); ?></div>
<?php
endif;
?>
</div>
</div>
<?php
if ($categorie['value'] === 'video'):
?>
<div id="video-portfolio-<?php echo $compteurVideo; ?>" class="slickModal">
<div class="slickWindow">
<!-- Your popup content -->
<iframe id="myVideo" src="<?php echo get_sub_field('url_de_la_video'); ?>" frameborder="0" allowfullscreen>
</iframe>
<!-- / Your popup content -->
</div>
</div>
<?php
$compteurVideo++;
endif;
$i++;
$compteurBoule++;
endwhile;
else :
// no rows found
endif;
?>
</div>
<div class="row">
<div class="col-12">
<div class="circleEnd"></div>
</div>
</div>
</div>
<?php get_footer(); ?>

View File

@ -0,0 +1,139 @@
<?php
/*
Template Name: Portfolio
*/
get_header();
?>
<div class="container">
<div class="row">
<div class="col-lg-12 accroche">
<h1><?php echo get_field('nom_de_la_page');?></h1>
</div>
<!-- <div class="offset-lg-8 col-lg-1"><div class="circleTop"></div></div>
<div class="col-12">
<div class="button-group">
<button class="tout is-checked" data-target="*">tout</button>
<button class="web" data-target=".web">web</button>
<button class="print" data-target=".print">print</button>
<button class="video" data-target=".video">vidéo</button>
<button class="motiondesign" data-target=".motiondesign">motion design</button>
</div>
</div> -->
</div>
</div>
<div class="container">
<div class="row grid">
<?php
// check if the repeater field has rows of data
$couleur = array(
'web' => '#1CC7C7' ,
'print' => '#C14FE3' ,
'motiondesign' => '#21D5F5',
'video' => '#21D5F5',
);
$i = 1;
$compteurBoule = 1;
$compteurVideo = 1;
if( have_rows('portfolio_beta') ):
// loop through the rows of data
while ( have_rows('portfolio_beta') ) : the_row();
$image = get_sub_field('image_du_projet');
$imageMobile = get_sub_field('image_du_projet_mobile');
$categorie = get_sub_field('categorie_du_projet');
$mouse = 'Mousenonactif';
//print_r($categorie);
$valeur = $categorie['value'];
// COMPTEUR BOULE
if($compteurBoule == 1):
elseif($compteurBoule == 2):
$pousseBoule = 'offset-lg-4';
elseif($compteurBoule == 3):
$pousseBoule = 'offset-lg-8';
$compteurBoule = 1;
endif;
// FIN COMPTEUR BOULE
// COMPTEUR VIDEO ET MOUSE VIDEO
if($categorie['value']=== 'video'):
$mouse = 'Mouseactive';
endif;
// FIN COMPTEUR VIDEO ET FIN MOUSE VIDEO
// LIEN VIDEO VIDE
$lienvideo = get_sub_field('url_de_la_video');
// FIN LIEN VIDEO VIDE
?>
<div class="col-12 element-item grid-sizer <?php echo $categorie['value'];?>" data-category="transition">
<div class="row">
<div class="<?php echo $pousseBoule; ?> col-lg-1"><div style="background-color: <?php echo $couleur[$valeur];?>" class="circleTop"></div></div>
<div class="col-12 <?php
if($categorie['value']=== 'video'):
echo("openSlickModal-".$compteurVideo);
endif;
if(empty($lienvideo)){
echo ' clickno';
}
?>">
<img class="large <?php echo $mouse; ?>" src="<?php echo $image['url'];?>" alt="<?php echo $image['alt']?>">
<img class="mobile" src="<?php echo $imageMobile['url'];?>" alt="<?php echo $imageMobile['alt']?>">
</div>
<?php
if($i % 2 == 0):
?>
<div style="color: <?php echo $couleur[$valeur];?>" class="col-lg-4">
<div style="background-color: <?php echo $couleur[$valeur];?>" class="barre"></div>
<h3><?php echo get_sub_field('nom_du_projet');?></h3>
<p class="client"><?php echo get_sub_field('nom_du_client');?></p>
</div>
<div class="col-lg-4 contenu"><?php echo get_sub_field('description_du_projet');?></div>
<?php
else:
?>
<div style="color: <?php echo $couleur[$valeur];?>" class="offset-lg-4 col-lg-4">
<div style="background-color: <?php echo $couleur[$valeur];?>" class="barre"></div>
<h3><?php echo get_sub_field('nom_du_projet');?></h3>
<p class="client"><?php echo get_sub_field('nom_du_client');?></p>
</div>
<div class="col-lg-4 contenu"><?php echo get_sub_field('description_du_projet');?></div>
<?php
endif;
?>
</div>
</div>
<?php
if($categorie['value']=== 'video'):
?>
<div id="video-portfolio-<?php echo $compteurVideo; ?>" class="slickModal">
<div class="slickWindow">
<!-- Your popup content -->
<iframe id="myVideo" src="<?php echo get_sub_field('url_de_la_video');?>" frameborder="0" allowfullscreen>
</iframe>
<!-- / Your popup content -->
</div>
</div>
<?php
$compteurVideo++;
endif;
$i++;
$compteurBoule++;
endwhile;
else :
// no rows found
endif;
?>
</div>
<div class="row">
<div class="col-12">
<div class="circleEnd"></div>
</div>
</div>
</div>
<?php get_footer();?>

View File

@ -1,15 +1,21 @@
<?php
<?php
/*
Template Name: Portfolio
*/
get_header();
$currentPageId = get_the_ID();
?>
<div class="container">
<div class="row">
<div class="col-lg-12 accroche">
<h1><?php echo get_field('nom_de_la_page');?></h1>
<h1><?php echo get_field('nom_de_la_page'); ?></h1>
</div>
<div class="offset-lg-8 col-lg-1">
<div class="circleTop"></div>
</div>
<div class="offset-lg-8 col-lg-1"><div class="circleTop"></div></div>
<div class="col-12">
<div class="button-group">
<button class="tout is-checked" data-target="*">tout</button>
@ -21,119 +27,192 @@ get_header();
</div>
</div>
</div>
<div class="container">
<div class="row grid">
<section class="projects-overview">
<?php
// check if the repeater field has rows of data
$couleur = array(
'web' => '#1CC7C7' ,
'print' => '#C14FE3' ,
'motiondesign' => '#21D5F5',
'video' => '#21D5F5',
);
$i = 1;
$compteurBoule = 1;
$compteurVideo = 1;
if( have_rows('portfolio_beta') ):
// loop through the rows of data
while ( have_rows('portfolio_beta') ) : the_row();
$image = get_sub_field('image_du_projet');
$imageMobile = get_sub_field('image_du_projet_mobile');
$categorie = get_sub_field('categorie_du_projet');
$mouse = 'Mousenonactif';
//print_r($categorie);
$valeur = $categorie['value'];
// COMPTEUR BOULE
if($compteurBoule == 1):
elseif($compteurBoule == 2):
$pousseBoule = 'offset-lg-4';
elseif($compteurBoule == 3):
$pousseBoule = 'offset-lg-8';
$compteurBoule = 1;
endif;
// FIN COMPTEUR BOULE
// COMPTEUR VIDEO ET MOUSE VIDEO
if($categorie['value']=== 'video'):
$mouse = 'Mouseactive';
endif;
// FIN COMPTEUR VIDEO ET FIN MOUSE VIDEO
// LIEN VIDEO VIDE
$lienvideo = get_sub_field('url_de_la_video');
// FIN LIEN VIDEO VIDE
?>
<div class="col-12 element-item grid-sizer <?php echo $categorie['value'];?>" data-category="transition">
<div class="row">
<div class="<?php echo $pousseBoule; ?> col-lg-1"><div style="background-color: <?php echo $couleur[$valeur];?>" class="circleTop"></div></div>
<div class="col-12 <?php
if($categorie['value']=== 'video'):
echo("openSlickModal-".$compteurVideo);
endif;
if(empty($lienvideo)){
echo ' clickno';
}
?>">
<img class="large <?php echo $mouse; ?>" src="<?php echo $image['url'];?>" alt="<?php echo $image['alt']?>">
<img class="mobile" src="<?php echo $imageMobile['url'];?>" alt="<?php echo $imageMobile['alt']?>">
</div>
<?php
if($i % 2 == 0):
?>
<div style="color: <?php echo $couleur[$valeur];?>" class="col-lg-4">
<div style="background-color: <?php echo $couleur[$valeur];?>" class="barre"></div>
<h3><?php echo get_sub_field('nom_du_projet');?></h3>
<p class="client"><?php echo get_sub_field('nom_du_client');?></p>
</div>
<div class="col-lg-4 contenu"><?php echo get_sub_field('description_du_projet');?></div>
<?php
else:
?>
<div style="color: <?php echo $couleur[$valeur];?>" class="offset-lg-4 col-lg-4">
<div style="background-color: <?php echo $couleur[$valeur];?>" class="barre"></div>
<h3><?php echo get_sub_field('nom_du_projet');?></h3>
<p class="client"><?php echo get_sub_field('nom_du_client');?></p>
</div>
<div class="col-lg-4 contenu"><?php echo get_sub_field('description_du_projet');?></div>
<?php
endif;
?>
</div>
</div>
$args = array(
'post_type' => 'portfolio',
'posts_per_page' => -1,
);
$portfolio_post = new WP_Query($args);
?>
<?php if ($portfolio_post->have_posts()) : while ($portfolio_post->have_posts()) : $portfolio_post->the_post(); ?>
<?php
if($categorie['value']=== 'video'):
?>
<div id="video-portfolio-<?php echo $compteurVideo; ?>" class="slickModal">
<div class="slickWindow">
<!-- Your popup content -->
<iframe id="myVideo" src="<?php echo get_sub_field('url_de_la_video');?>" frameborder="0" allowfullscreen>
</iframe>
<!-- / Your popup content -->
</div>
$projectThumbnailUrl = get_the_post_thumbnail_url($portfolio_post->ID, 'full');
$projectPermLink = get_the_permalink($portfolio_post->ID);
?>
<div class="project-card">
<a href="<?php echo $projectPermLink ?>">
<img src="<?php echo $projectThumbnailUrl ?>" alt="">
</a>
<h2><?php the_title(); ?></h2>
<p><?php the_content(); ?></p>
<a href="<?php the_permalink(); ?>">Voir le projet</a>
</div>
<?php endwhile; ?>
<?php endif; ?>
</section>
<section class="old-project container">
<?php
$portfolio_beta = get_field('portfolio_beta', $currentPageId);
$cat_colors = array(
'web' => '#1CC7C7',
'print' => '#C14FE3',
'motiondesign' => '#21D5F5',
'video' => '#21D5F5',
);
?>
<?php
$project_id = $portfolio_post->ID;
$projectUrl = get_permalink($project_id);
$thumbnailUrl = get_the_post_thumbnail_url($project_id, 'full');
$mobileThumbnailUrl = get_the_post_thumbnail_url($project_id, 'full');
$projectDescription = get_field('project_description', $project_id);
$pousseBoule = 'offset-lg-8';
$projectType = 'web';
$projectTitle = get_the_title($project_id);
$clientName = get_field('client_name', $project_id);
$currentProjectColor = $cat_colors[$projectType];
$mouse = $categorie === 'video' ? 'Mouseactive' : null;
$i = 3;
$ballOffset = $i === 1 ? 'offset-lg-4' : ($i === 2 ? 'offset-lg-4' : 'offset-lg-8');
?>
<?php
// check if the repeater field has rows of data
$couleur = array(
'web' => '#1CC7C7',
'print' => '#C14FE3',
'motiondesign' => '#21D5F5',
'video' => '#21D5F5',
);
$i = 1;
$compteurBoule = 1;
$compteurVideo = 1;
?>
<?php foreach ($portfolio_beta as $portfolio_project): ?>
<?php
$projectName = $portfolio_project['nom_du_projet'];
$clientName = $portfolio_project['nom_du_client'];
$projectDescription = $portfolio_project['description_du_projet'];
$image = $portfolio_project['image_du_projet'];
$imageMobile = $portfolio_project['image_du_projet_mobile'];
$categorie = $portfolio_project['categorie_du_projet'];
$mouse = 'Mousenonactif';
$valeur = $categorie['value'];
// COMPTEUR BOULE
if ($compteurBoule == 1):
elseif ($compteurBoule == 2):
$pousseBoule = 'offset-lg-4';
elseif ($compteurBoule == 3):
$pousseBoule = 'offset-lg-8';
$compteurBoule = 1;
endif;
// FIN COMPTEUR BOULE
// COMPTEUR VIDEO ET MOUSE VIDEO
if ($categorie['value'] === 'video'):
$mouse = 'Mouseactive';
endif;
// FIN COMPTEUR VIDEO ET FIN MOUSE VIDEO
// LIEN VIDEO VIDE
$lienvideo = $portfolio_project['url_de_la_video'];
// FIN LIEN VIDEO VIDE
?>
<div class="col-12 element-item grid-sizer <?php echo $categorie['value']; ?>" data-category="transition">
<div class="row">
<div class="<?php echo $pousseBoule; ?> col-lg-1">
<div style="background-color: <?php echo $cat_colors[$valeur]; ?>" class="circleTop"></div>
</div>
<div class="col-12 <?php
if ($categorie['value'] === 'video'):
echo ("openSlickModal-" . $compteurVideo);
endif;
if (empty($lienvideo)) {
echo ' clickno';
}
?>">
<img class="large <?php echo $mouse; ?>" src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt'] ?>">
<img class="mobile" src="<?php echo $imageMobile['url']; ?>" alt="<?php echo $imageMobile['alt'] ?>">
</div>
<?php
$compteurVideo++;
endif;
if ($i % 2 == 0):
?>
<div style="color: <?php echo $cat_colors[$valeur]; ?>" class="col-lg-4">
<div style="background-color: <?php echo $cat_colors[$valeur]; ?>" class="barre"></div>
<h3><?php echo $projectName ?></h3>
<p class="client"><?php echo $clientName ?></p>
</div>
<div class="col-lg-4 contenu"><?php echo $projectDescription ?></div>
<?php
else:
?>
<div style="color: <?php echo $cat_colors[$valeur]; ?>" class="offset-lg-4 col-lg-4">
<div style="background-color: <?php echo $cat_colors[$valeur]; ?>" class="barre"></div>
<h3><?php echo $projectName ?></h3>
<p class="client"><?php echo $clientName ?></p>
</div>
<div class="col-lg-4 contenu"><?php echo $projectDescription ?></div>
<?php
endif;
?>
$i++;
$compteurBoule++;
endwhile;
else :
// no rows found
</div>
</div>
<?php if ($categorie['value'] === 'video'): ?>
<div id="video-portfolio-<?php echo $compteurVideo; ?>" class="slickModal">
<div class="slickWindow">
<!-- Your popup content -->
<iframe id="myVideo" src="<?php echo get_sub_field('url_de_la_video'); ?>" frameborder="0" allowfullscreen>
</iframe>
<!-- / Your popup content -->
</div>
</div>
<?php
$compteurVideo++;
endif;
$i++;
$compteurBoule++;
?>
<?php endforeach; ?>
</div>
<div class="row">
<div class="col-12">
<div class="circleEnd"></div>
<div class="col-12">
<div class="circleEnd"></div>
</div>
</div>
</div>
</div>
<?php get_footer();?>
</section>
<?php get_footer(); ?>

View File

@ -32,7 +32,7 @@
},
"color": {
"defaultPalette": false,
"custom": false,
"custom": true,
"palette": [
{
"name": "Primaire",
@ -40,94 +40,24 @@
"color": "#2F0154"
},
{
"name": "Primaire Light",
"slug": "primary-light",
"color": "#F4F2F6"
"name": "Deli Pink",
"slug": "deli-pink",
"color": "#e91969"
},
{
"name": "Primaire Survol",
"slug": "primary-hover",
"color": "#130023"
"name": "Deli Blue",
"slug": "deli-blue",
"color": "#1cc7c7"
},
{
"name": "Secondaire",
"slug": "secondary",
"color": "#DF1E1E"
"name": "Deli Purple",
"slug": "deli-purple",
"color": "#C14FE3"
},
{
"name": "Secondaire Light",
"slug": "secondary-light",
"color": "#FEF5F6"
},
{
"name": "Infos",
"slug": "infos",
"color": "#FFE9A3"
},
{
"name": "Secondaire Au Survol",
"slug": "secondary-hover",
"color": "#980303"
},
{
"name": "Gris",
"slug": "gray",
"color": "#F7F7F7"
},
{
"name": "Gris Foncé",
"slug": "gray-dark",
"color": "#767575"
},
{
"name": "Acoustique / Copropriétés",
"slug": "acoustique-coproprietes",
"color": "#245EF2"
},
{
"name": "Acoustique / Copropriétés | Light",
"slug": "acoustique-coproprietes-light",
"color": "#DFF1FF"
},
{
"name": "Énergies / Urbanisme",
"slug": "energies-urbanisme",
"color": "#027E50"
},
{
"name": "Énergies / Urbanisme | Light",
"slug": "energies-urbanisme-light",
"color": "#E3FFF0"
},
{
"name": "Isolation / Quotidien",
"slug": "isolation-quotidien",
"color": "#C24503"
},
{
"name": "Isolation / Quotidien | Light",
"slug": "isolation-quotidien-light",
"color": "#FFFBEC"
},
{
"name": "Patrimoine / Rénovation",
"slug": "patrimoine-sante-securite",
"color": "#8B2FF7"
},
{
"name": "Patrimoine / Rénovation | Light",
"slug": "patrimoine-sante-securite-light",
"color": "#F8F2FF"
},
{
"name": "Location / Rénovation Circulaire",
"slug": "location-durabilite",
"color": "#DF002B"
},
{
"name": "Location | Light",
"slug": "location-durabilite-light",
"color": "#FFF3F5"
"name": "Deli Orange",
"slug": "deli-orange",
"color": "#FAA400"
}
],
"gradients": [
@ -135,26 +65,6 @@
"slug": "gradient-blue",
"gradient": "linear-gradient(160deg, #3C75FF, #0BB1FF)",
"name": "Blue Gradient"
},
{
"slug": "gradient-green",
"gradient": "linear-gradient(160deg, #008050, #09D17B)",
"name": "Green Gradient"
},
{
"slug": "gradient-red",
"gradient": "linear-gradient(160deg, #F40634, #FF928B)",
"name": "Red Gradient"
},
{
"slug": "gradient-yellow",
"gradient": "linear-gradient(160deg, #D44A00, #FE9000)",
"name": "Yellow Gradient"
},
{
"slug": "gradient-purple",
"gradient": "linear-gradient(160deg, #8B2FF7, #EB79FF)",
"name": "Purple Gradient"
}
]
},

25
vendor/autoload.php vendored Normal file
View File

@ -0,0 +1,25 @@
<?php
// 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';
return ComposerAutoloaderInit3f8faf064fda462a6a77d3c1c9587aeb::getLoader();

585
vendor/composer/ClassLoader.php vendored Normal file
View File

@ -0,0 +1,585 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;
/** @var ?string */
private $vendorDir;
// PSR-4
/**
* @var array[]
* @psalm-var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, array<int, string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* @var array[]
* @psalm-var array<string, array<string, string[]>>
*/
private $prefixesPsr0 = array();
/**
* @var array[]
* @psalm-var array<string, string>
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var string[]
* @psalm-var array<string, string>
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var bool[]
* @psalm-var array<string, bool>
*/
private $missingClasses = array();
/** @var ?string */
private $apcuPrefix;
/**
* @var self[]
*/
private static $registeredLoaders = array();
/**
* @param ?string $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
* @return string[]
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
/**
* @return array[]
* @psalm-return array<string, array<int, string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return array[]
* @psalm-return array<string, string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return array[]
* @psalm-return array<string, string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return string[] Array of classname => path
* @psalm-return array<string, string>
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param string[] $classMap Class to filename map
* @psalm-param array<string, string> $classMap
*
* @return void
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
/**
* Returns the currently registered loaders indexed by their corresponding vendor directories.
*
* @return self[]
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
}
/**
* 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);
}
}

359
vendor/composer/InstalledVersions.php vendored Normal file
View File

@ -0,0 +1,359 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/
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;
/**
* @var bool|null
*/
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();
/**
* Returns a list of all package names which are present, either by being installed, replaced or provided
*
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
/**
* Returns a list of all package names with a specific type e.g. 'library'
*
* @param string $type
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackagesByType($type)
{
$packagesByType = array();
foreach (self::getInstalled() as $installed) {
foreach ($installed['versions'] as $name => $package) {
if (isset($package['type']) && $package['type'] === $type) {
$packagesByType[] = $name;
}
}
}
return $packagesByType;
}
/**
* Checks whether the given package is installed
*
* This also returns true if the package name is provided or replaced by another package
*
* @param string $packageName
* @param bool $includeDevRequirements
* @return bool
*/
public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}
return false;
}
/**
* Checks whether the given package satisfies a version constraint
*
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
*
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
*
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
* @param string $packageName
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
* @return bool
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
/**
* Returns a version constraint representing all the range(s) which are installed for a given package
*
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
* whether a given version of a package is installed, and not just whether it exists
*
* @param string $packageName
* @return string Version constraint usable with composer/semver
*/
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
*/
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
*/
public static function getInstallPath($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @return array
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
/**
* Returns the raw installed.php data for custom implementations
*
* @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[]
* @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[]}>}
*/
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
if (null === self::$installed) {
// 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
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = include __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
return self::$installed;
}
/**
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @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[]}>}>
*/
public static function getAllRawData()
{
return self::getInstalled();
}
/**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
* this class but then also needs to execute another project's autoloader in process,
* and wants to ensure both projects have access to their version of installed.php.
*
* A typical case would be PHPUnit, where it would need to make sure it reads all
* the data it needs from this class, then call reload() with
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
* the project in which it runs can then also use this class safely, without
* interference between PHPUnit's dependencies and the project's dependencies.
*
* @param array[] $data A vendor/composer/installed.php data set
* @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
*/
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = 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[]}>}>
*/
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} 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 */
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
}
}
}
if (null === self::$installed) {
// 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
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 */
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else {
self::$installed = array();
}
}
if (self::$installed !== array()) {
$installed[] = self::$installed;
}
return $installed;
}
}

21
vendor/composer/LICENSE vendored Normal file
View File

@ -0,0 +1,21 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

10
vendor/composer/autoload_classmap.php vendored Normal file
View File

@ -0,0 +1,10 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
);

10
vendor/composer/autoload_files.php vendored Normal file
View File

@ -0,0 +1,10 @@
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'ac773ca18bc86f9208de2ed8068423eb' => $vendorDir . '/johnbillion/extended-cpts/functions.php',
);

View File

@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
);

12
vendor/composer/autoload_psr4.php vendored Normal file
View File

@ -0,0 +1,12 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'ExtCPTs\\Tests\\' => array($vendorDir . '/johnbillion/extended-cpts/tests/integration'),
'ExtCPTs\\' => array($vendorDir . '/johnbillion/extended-cpts/src'),
'Args\\' => array($vendorDir . '/johnbillion/args/src'),
);

50
vendor/composer/autoload_real.php vendored Normal file
View File

@ -0,0 +1,50 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit3f8faf064fda462a6a77d3c1c9587aeb
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit3f8faf064fda462a6a77d3c1c9587aeb', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit3f8faf064fda462a6a77d3c1c9587aeb', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit3f8faf064fda462a6a77d3c1c9587aeb::getInitializer($loader));
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit3f8faf064fda462a6a77d3c1c9587aeb::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}, null, null);
foreach ($filesToLoad as $fileIdentifier => $file) {
$requireFile($fileIdentifier, $file);
}
return $loader;
}
}

53
vendor/composer/autoload_static.php vendored Normal file
View File

@ -0,0 +1,53 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit3f8faf064fda462a6a77d3c1c9587aeb
{
public static $files = array (
'ac773ca18bc86f9208de2ed8068423eb' => __DIR__ . '/..' . '/johnbillion/extended-cpts/functions.php',
);
public static $prefixLengthsPsr4 = array (
'E' =>
array (
'ExtCPTs\\Tests\\' => 14,
'ExtCPTs\\' => 8,
),
'A' =>
array (
'Args\\' => 5,
),
);
public static $prefixDirsPsr4 = array (
'ExtCPTs\\Tests\\' =>
array (
0 => __DIR__ . '/..' . '/johnbillion/extended-cpts/tests/integration',
),
'ExtCPTs\\' =>
array (
0 => __DIR__ . '/..' . '/johnbillion/extended-cpts/src',
),
'Args\\' =>
array (
0 => __DIR__ . '/..' . '/johnbillion/args/src',
),
);
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit3f8faf064fda462a6a77d3c1c9587aeb::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit3f8faf064fda462a6a77d3c1c9587aeb::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit3f8faf064fda462a6a77d3c1c9587aeb::$classMap;
}, null, ClassLoader::class);
}
}

188
vendor/composer/installed.json vendored Normal file
View File

@ -0,0 +1,188 @@
{
"packages": [
{
"name": "johnbillion/args",
"version": "1.10.0",
"version_normalized": "1.10.0.0",
"source": {
"type": "git",
"url": "https://github.com/johnbillion/args.git",
"reference": "ef670a14ce0b9221cee0a39f076f4810a200d1ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/johnbillion/args/zipball/ef670a14ce0b9221cee0a39f076f4810a200d1ac",
"reference": "ef670a14ce0b9221cee0a39f076f4810a200d1ac",
"shasum": ""
},
"require": {
"php": ">=7.4"
},
"require-dev": {
"ergebnis/json-printer": "^3.2",
"ergebnis/phpstan-rules": "^1.0",
"humanmade/coding-standards": "^1.1",
"johnbillion/falsey-assertequals-detector": "^3",
"phpdocumentor/reflection": "~4.0 || ~5.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.1",
"phpunit/phpunit": "^9.0",
"roots/wordpress-core-installer": "^1.0.0",
"roots/wordpress-full": "~6.5.0"
},
"time": "2024-04-02T21:50:24+00:00",
"type": "library",
"extra": {
"args-shapes": [
"--function=\"\\get_categories()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category.php",
"--function=\"\\get_comments()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/comment.php",
"--function=\"\\get_posts()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\get_tags()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category.php",
"--function=\"\\get_terms()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\get_users()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/user.php",
"--function=\"\\paginate_links()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/general-template.php",
"--function=\"\\register_block_type()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/blocks.php",
"--function=\"\\register_meta()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/meta.php",
"--function=\"\\register_post_meta()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\register_post_status()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\register_post_type()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\register_rest_field()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/rest-api.php",
"--function=\"\\register_taxonomy()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\register_term_meta()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_count_terms()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_die()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/functions.php",
"--function=\"\\wp_dropdown_categories()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category-template.php",
"--function=\"\\wp_dropdown_languages()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/l10n.php",
"--function=\"\\wp_generate_tag_cloud()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category-template.php",
"--function=\"\\wp_get_nav_menus()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/nav-menu.php",
"--function=\"\\wp_get_object_terms()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_insert_post()\" --param=postarr --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\wp_insert_term()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_insert_user()\" --param=userdata --file=vendor/wordpress/wordpress/wp-includes/user.php",
"--function=\"\\wp_nav_menu()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/nav-menu-template.php",
"--function=\"\\wp_remote_get()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_remote_head()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_remote_post()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_remote_request()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_get()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_head()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_post()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_request()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_update_post()\" --param=postarr --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\wp_update_term()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_update_user()\" --param=userdata --file=vendor/wordpress/wordpress/wp-includes/user.php",
"--method=\"\\WP_Block_Type::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-block-type.php",
"--method=\"\\WP_Comment_Query::__construct()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-comment-query.php",
"--method=\"\\WP_Customize_Control::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-control.php",
"--method=\"\\WP_Customize_Manager::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-manager.php",
"--method=\"\\WP_Customize_Panel::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-panel.php",
"--method=\"\\WP_Customize_Section::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-section.php",
"--method=\"\\WP_Customize_Setting::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-setting.php",
"--method=\"\\WP_Http::request()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-http.php",
"--method=\"\\WP_Query::parse_query()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-query.php",
"--method=\"\\WP_Term_Query::__construct()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-term-query.php",
"--method=\"\\WP_User_Query::prepare_query()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-user-query.php"
],
"wordpress-install-dir": "vendor/wordpress/wordpress"
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Args\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "John Blackbourn",
"homepage": "https://johnblackbourn.com/"
}
],
"description": "I don't want to get into an argument about this.",
"support": {
"issues": "https://github.com/johnbillion/args/issues",
"source": "https://github.com/johnbillion/args/tree/1.10.0"
},
"funding": [
{
"url": "https://github.com/sponsors/johnbillion",
"type": "github"
}
],
"install-path": "../johnbillion/args"
},
{
"name": "johnbillion/extended-cpts",
"version": "5.0.11",
"version_normalized": "5.0.11.0",
"source": {
"type": "git",
"url": "https://github.com/johnbillion/extended-cpts.git",
"reference": "57f2e74155a12e7a37d07250e6739dbab5a732b3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/johnbillion/extended-cpts/zipball/57f2e74155a12e7a37d07250e6739dbab5a732b3",
"reference": "57f2e74155a12e7a37d07250e6739dbab5a732b3",
"shasum": ""
},
"require": {
"johnbillion/args": "^1.4.1 || ^2.0",
"php": ">= 7.4.0"
},
"require-dev": {
"automattic/phpcs-neutron-standard": "1.7.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"johnbillion/falsey-assertequals-detector": "*",
"johnbillion/plugin-infrastructure": "dev-trunk",
"johnbillion/wp-compat": "0.3.1",
"lucatume/wp-browser": "3.2.3",
"phpcompatibility/phpcompatibility-wp": "2.1.5",
"phpstan/phpstan": "1.12.12",
"phpstan/phpstan-phpunit": "1.4.1",
"roots/wordpress-core-installer": "1.100.0",
"roots/wordpress-full": "*",
"szepeviktor/phpstan-wordpress": "1.3.5",
"wp-coding-standards/wpcs": "2.3.0"
},
"time": "2024-11-30T23:16:17+00:00",
"type": "library",
"extra": {
"wordpress-install-dir": "vendor/wordpress/wordpress"
},
"installation-source": "dist",
"autoload": {
"files": [
"functions.php"
],
"psr-4": {
"ExtCPTs\\": "src",
"ExtCPTs\\Tests\\": "tests/integration"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "John Blackbourn",
"homepage": "https://johnblackbourn.com/"
}
],
"description": "A library which provides extended functionality to WordPress custom post types and taxonomies.",
"homepage": "https://github.com/johnbillion/extended-cpts/",
"support": {
"issues": "https://github.com/johnbillion/extended-cpts/issues",
"source": "https://github.com/johnbillion/extended-cpts/tree/5.0.11"
},
"install-path": "../johnbillion/extended-cpts"
}
],
"dev": true,
"dev-package-names": []
}

41
vendor/composer/installed.php vendored Normal file
View File

@ -0,0 +1,41 @@
<?php return array(
'root' => array(
'name' => '__root__',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'b78156fe35825343962555867f13ebfaba83c524',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => true,
),
'versions' => array(
'__root__' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'b78156fe35825343962555867f13ebfaba83c524',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'johnbillion/args' => array(
'pretty_version' => '1.10.0',
'version' => '1.10.0.0',
'reference' => 'ef670a14ce0b9221cee0a39f076f4810a200d1ac',
'type' => 'library',
'install_path' => __DIR__ . '/../johnbillion/args',
'aliases' => array(),
'dev_requirement' => false,
),
'johnbillion/extended-cpts' => array(
'pretty_version' => '5.0.11',
'version' => '5.0.11.0',
'reference' => '57f2e74155a12e7a37d07250e6739dbab5a732b3',
'type' => 'library',
'install_path' => __DIR__ . '/../johnbillion/extended-cpts',
'aliases' => array(),
'dev_requirement' => false,
),
),
);

26
vendor/composer/platform_check.php vendored Normal file
View File

@ -0,0 +1,26 @@
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 70400)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}

339
vendor/johnbillion/args/LICENSE vendored Normal file
View File

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{{description}}
Copyright (C) {{year}} {{fullname}}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

248
vendor/johnbillion/args/README.md vendored Normal file
View File

@ -0,0 +1,248 @@
[![](https://img.shields.io/github/actions/workflow/status/johnbillion/args/tests.yml?branch=trunk&style=flat-square)](https://github.com/johnbillion/args/actions)
# Args
Many functions and methods in WordPress accept arguments as an associative array which your IDE or code editor cannot autocomplete like it does for individual function parameters.
```php
$query = new WP_Query( [
'post_type' => 'post',
'category' => 'does this accept an ID or a slug?',
'number_of_...errr'
] );
```
This library provides well-documented classes which represent many of the associative array parameters used throughout WordPress. Using them at the point where you populate the arguments means you get autocompletion and intellisense in your code editor, and strict typing thanks to typed properties in PHP 7.4. Comprehensive types and constraints for [PHPStan](https://phpstan.org/) are also included.
![](.github/assets/screenshot.png)
## Current Status
Last updated for WordPress 6.5.
## Requirements
* PHP 7.4 or PHP 8+
## Installation
```shell
composer require johnbillion/args
```
## Usage
Usage with a class constructor:
```php
$args = new \Args\WP_Query;
$args->tag = 'amazing';
$args->posts_per_page = 100;
$query = new \WP_Query( $args->toArray() );
```
Usage with a procedural function parameter:
```php
$args = new \Args\register_post_type;
$args->show_in_rest = true;
$args->taxonomies = [ 'genre', 'audience' ];
$story = register_post_type( 'story', $args->toArray() );
```
## Meta Queries, Tax Queries, and Date Queries
The query classes in WordPress support variously `meta_query`, `tax_query`, and `date_query` arguments. These are fully supported and you can construct them in a structured and strongly typed way.
Creating a `meta_query` argument:
```php
$args = new \Args\WP_Query;
// Create a clause
$clause = new \Args\MetaQuery\Clause;
$clause->key = 'my_meta_key';
$clause->value = 'my_meta_value';
// Add the clause
$args->meta_query->clauses[] = $clause;
$query = new \WP_Query( $args->toArray() );
```
Creating a `tax_query` argument:
```php
$args = new \Args\WP_Query;
// Create a clause
$clause = new \Args\TaxQuery\Clause;
$clause->taxonomy = 'post_tag';
$clause->terms = [ 'amazing' ];
// Add the clause
$args->tax_query->clauses[] = $clause;
$query = new \WP_Query( $args->toArray() );
```
Creating a `date_query` argument:
```php
$args = new \Args\WP_Query;
// Create a clause
$clause = new \Args\DateQuery\Clause;
$clause->year = 2000;
$clause->compare = '>=';
// Add the clause
$args->date_query->clauses[] = $clause;
$query = new \WP_Query( $args->toArray() );
```
Alternatively you can construct a complete query object by calling the `fromArray()` static method with the same nested array syntax that WordPress core uses:
```php
$args = new \Args\WP_Query;
// Set the meta query from an array
$array = [
[
'key' => 'my_meta_key',
'value' => 'my_meta_value',
]
];
$args->meta_query = $args->meta_query::fromArray( $array );
$query = new \WP_Query( $args->toArray() );
```
## What's Provided
### Posts
* `\Args\WP_Query`
* `\Args\register_post_type`
* `\Args\wp_insert_post`
* `\Args\wp_update_post`
* `\Args\get_posts`
* `\Args\register_post_meta`
* `\Args\register_post_status`
### Taxonomies and Terms
* `\Args\WP_Term_Query`
* `\Args\register_taxonomy`
* `\Args\wp_insert_term`
* `\Args\wp_update_term`
* `\Args\get_terms`
* `\Args\get_categories`
* `\Args\get_tags`
* `\Args\register_term_meta`
* `\Args\wp_count_terms`
* `\Args\wp_get_object_terms`
* `\Args\wp_dropdown_categories`
### Users
* `\Args\WP_User_Query`
* `\Args\wp_insert_user`
* `\Args\wp_update_user`
* `\Args\get_users`
### Comments
* `\Args\WP_Comment_Query`
* `\Args\get_comments`
### HTTP API
* `\Args\wp_remote_get`
* `\Args\wp_remote_post`
* `\Args\wp_remote_head`
* `\Args\wp_remote_request`
* `\Args\wp_safe_remote_get`
* `\Args\wp_safe_remote_post`
* `\Args\wp_safe_remote_head`
* `\Args\wp_safe_remote_request`
### Blocks
* `\Args\WP_Block_Type`
* `\Args\register_block_type`
### Customizer
* `\Args\WP_Customize_Control`
* `\Args\WP_Customize_Manager`
* `\Args\WP_Customize_Panel`
* `\Args\WP_Customize_Section`
* `\Args\WP_Customize_Setting`
### Everything Else
* `\Args\paginate_links`
* `\Args\register_meta`
* `\Args\register_rest_field`
* `\Args\wp_get_nav_menus`
* `\Args\wp_nav_menu`
* `\Args\wp_die`
* `\Args\wp_dropdown_languages`
* `\Args\wp_generate_tag_cloud`
## Type Checking
Typed class properties are implemented in this library where possible. If you pass a value of the wrong type to an argument that is typed, you'll get a fatal error as long as you're using strict types:
```php
<?php
declare( strict_types=1 );
```
No more mysterious bugs due to incorrect types.
Note that several parameters in WordPress accept multiple types, for example the `$ignore_sticky_posts` argument for `\WP_Query` can be a boolean or an integer. In some of these cases I've opted to type the parameter with the most appropriate type even though it can technically accept other types.
## Static Analysis
PHPStan-specific `@phpstan-var` tags are used for properties that have a fixed set of values or other constraints. This allows for even greater type and value checking via static analysis with PHPStan.
Ensure you're using PHPStan 1.0 or higher to make the best use of these constraints.
## Contributing
Check out [CONTRIBUTING.md](CONTRIBUTING.md) for information about generating your own Args definitions or contributing to the Args library.
## But Why?
I have a name for these array-type parameters for passing arguments. I call them *Stockholm Parameters*. We've gotten so used to using them that we forget what a terrible design pattern it is. This library exists to work around the immediate issue without rearchitecting the whole of WordPress.
## Sponsors
The time that I spend maintaining this library and others is in part sponsored by:
[![Automattic](.github/assets/gh/automattic.png)](https://automattic.com)
Plus all my kind sponsors on GitHub:
[![Sponsors](.github/assets/gh/everyone.png)](https://github.com/sponsors/johnbillion)
[Click here to find out about supporting this library and my other WordPress development tools and plugins](https://github.com/sponsors/johnbillion).
## License: GPLv2
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

126
vendor/johnbillion/args/composer.json vendored Normal file
View File

@ -0,0 +1,126 @@
{
"name": "johnbillion/args",
"description": "I don't want to get into an argument about this.",
"type": "library",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "John Blackbourn",
"homepage": "https://johnblackbourn.com/"
}
],
"config": {
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"roots/wordpress-core-installer": true
}
},
"require": {
"php": ">=7.4"
},
"autoload": {
"psr-4": {
"Args\\": "src/"
}
},
"scripts": {
"generate": [
"@php bin/generate.php"
],
"test:shapes": [
"@php bin/shapes.php"
],
"test:shape": [
"@php bin/shape.php"
],
"test:phpcs": [
"phpcs -p --basepath='./' ."
],
"test:phpunit": [
"phpunit --testdox"
],
"test:phpstan": [
"phpstan analyze"
],
"test": [
"@test:shapes",
"@test:phpcs",
"@test:phpunit",
"@test:phpstan"
]
},
"extra": {
"args-shapes": [
"--function=\"\\get_categories()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category.php",
"--function=\"\\get_comments()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/comment.php",
"--function=\"\\get_posts()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\get_tags()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category.php",
"--function=\"\\get_terms()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\get_users()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/user.php",
"--function=\"\\paginate_links()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/general-template.php",
"--function=\"\\register_block_type()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/blocks.php",
"--function=\"\\register_meta()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/meta.php",
"--function=\"\\register_post_meta()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\register_post_status()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\register_post_type()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\register_rest_field()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/rest-api.php",
"--function=\"\\register_taxonomy()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\register_term_meta()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_count_terms()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_die()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/functions.php",
"--function=\"\\wp_dropdown_categories()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category-template.php",
"--function=\"\\wp_dropdown_languages()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/l10n.php",
"--function=\"\\wp_generate_tag_cloud()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/category-template.php",
"--function=\"\\wp_get_nav_menus()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/nav-menu.php",
"--function=\"\\wp_get_object_terms()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_insert_post()\" --param=postarr --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\wp_insert_term()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_insert_user()\" --param=userdata --file=vendor/wordpress/wordpress/wp-includes/user.php",
"--function=\"\\wp_nav_menu()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/nav-menu-template.php",
"--function=\"\\wp_remote_get()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_remote_head()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_remote_post()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_remote_request()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_get()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_head()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_post()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_safe_remote_request()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/http.php",
"--function=\"\\wp_update_post()\" --param=postarr --file=vendor/wordpress/wordpress/wp-includes/post.php",
"--function=\"\\wp_update_term()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/taxonomy.php",
"--function=\"\\wp_update_user()\" --param=userdata --file=vendor/wordpress/wordpress/wp-includes/user.php",
"--method=\"\\WP_Block_Type::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-block-type.php",
"--method=\"\\WP_Comment_Query::__construct()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-comment-query.php",
"--method=\"\\WP_Customize_Control::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-control.php",
"--method=\"\\WP_Customize_Manager::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-manager.php",
"--method=\"\\WP_Customize_Panel::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-panel.php",
"--method=\"\\WP_Customize_Section::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-section.php",
"--method=\"\\WP_Customize_Setting::__construct()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-customize-setting.php",
"--method=\"\\WP_Http::request()\" --param=args --file=vendor/wordpress/wordpress/wp-includes/class-wp-http.php",
"--method=\"\\WP_Query::parse_query()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-query.php",
"--method=\"\\WP_Term_Query::__construct()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-term-query.php",
"--method=\"\\WP_User_Query::prepare_query()\" --param=query --file=vendor/wordpress/wordpress/wp-includes/class-wp-user-query.php"
],
"wordpress-install-dir": "vendor/wordpress/wordpress"
},
"require-dev": {
"ergebnis/json-printer": "^3.2",
"ergebnis/phpstan-rules": "^1.0",
"humanmade/coding-standards": "^1.1",
"johnbillion/falsey-assertequals-detector": "^3",
"phpdocumentor/reflection": "~4.0 || ~5.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.1",
"phpunit/phpunit": "^9.0",
"roots/wordpress-core-installer": "^1.0.0",
"roots/wordpress-full": "~6.5.0"
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/johnbillion"
}
]
}

View File

@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Args\Arrayable;
/**
* Arguments object that can be converted to an array.
*/
interface Arrayable {
/**
* @return ?array<string|int,mixed>
*/
public function toArray() :? array;
}

View File

@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace Args\Arrayable;
/**
* An arguments object which provides a vanilla `fromArray()` method.
*/
trait ProvidesFromArray {
/**
* @param array<string, mixed> $args
* @return static
*/
final public static function fromArray( array $args ) : self {
$class = new static();
foreach ( $args as $key => $value ) {
$class->$key = $value;
}
return $class;
}
}

View File

@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace Args\Arrayable;
/**
* An arguments object which provides a vanilla `toArray()` method.
*/
trait ProvidesToArray {
/** @var array<string, string> */
protected array $map = [];
/**
* @return array<string, string>
*/
final public function getMap() : array {
return $this->map;
}
/**
* @return array<string,mixed>
*/
final public function toArray() : array {
$vars = get_object_vars( $this );
foreach ( $this->getMap() as $from => $to ) {
if ( array_key_exists( $from, $vars ) ) {
$vars[ $to ] = $vars[ $from ];
unset( $vars[ $from ] );
}
}
unset( $vars['map'] );
foreach ( $vars as $key => $var ) {
if ( ! $var instanceof Arrayable ) {
continue;
}
$vars[ $key ] = $var->toArray();
}
$vars = array_filter( $vars, fn( $value ) : bool => $value !== null );
ksort( $vars );
return $vars;
}
}

View File

@ -0,0 +1,179 @@
<?php
declare(strict_types=1);
namespace Args\DateQuery;
use Args\Arrayable\Arrayable;
/**
* Arguments for a clause within a date query, for example those within a `$date_query` argument.
*/
final class Clause implements Arrayable, Values {
use \Args\Arrayable\ProvidesFromArray;
use \Args\Arrayable\ProvidesToArray;
/**
* Date to retrieve posts before. Accepts `strtotime()`-compatible string, or array of 'year', 'month', 'day' values.
*
* @var string|array<string, string>
* @phpstan-var string|array{
* year: numeric-string,
* month?: numeric-string,
* day?: numeric-string,
* }
*/
public $before;
/**
* Date to retrieve posts after. Accepts `strtotime()`-compatible string, or array of 'year', 'month', 'day' values.
*
* @var string|array<string, string>
* @phpstan-var string|array{
* year: numeric-string,
* month?: numeric-string,
* day?: numeric-string,
* }
*/
public $after;
/**
* Used to add a clause comparing a column other than
* the column specified in the top-level `$column` parameter.
* See WP_Date_Query::validate_column() and
* the {@see 'date_query_valid_columns'} filter for the list
* of accepted values.
*
* Default is the value of top-level `$column`.
*/
public string $column;
/**
* The comparison operator. Accepts '=', '!=', '>', '>=',
* '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'. 'IN',
* 'NOT IN', 'BETWEEN', and 'NOT BETWEEN'. Comparisons support
* arrays in some time-related parameters.
*
* Default '='.
*
* @phpstan-var Values::DATE_QUERY_COMPARE_*
*/
public string $compare;
/**
* Include results from dates specified in 'before' or 'after'.
*
* Default false.
*/
public bool $inclusive;
/**
* The four-digit year number. Accepts any four-digit year
* or an array of years if `$compare` supports it.
*
* Default empty.
*
* @var int|int[]
*/
public $year;
/**
* The two-digit month number. Accepts numbers 1-12 or an
* array of valid numbers if `$compare` supports it.
*
* Default empty.
*
* @var int|int[]
* @phpstan-var int<1,12>|array<int, int<1,12>>
*/
public $month;
/**
* The week number of the year. Accepts numbers 0-53 or an
* array of valid numbers if `$compare` supports it.
*
* Default empty.
*
* @var int|int[]
* @phpstan-var int<0,53>|array<int, int<0,53>>
*/
public $week;
/**
* The day number of the year. Accepts numbers 1-366 or an
* array of valid numbers if `$compare` supports it.
*
* Default empty.
*
* @var int|int[]
* @phpstan-var int<1,366>|array<int, int<1,366>>
*/
public $dayofyear;
/**
* The day of the month. Accepts numbers 1-31 or an array
* of valid numbers if `$compare` supports it.
*
* Default empty.
*
* @var int|int[]
* @phpstan-var int<1,31>|array<int, int<1,31>>
*/
public $day;
/**
* The day number of the week. Accepts numbers 1-7 (1 is
* Sunday) or an array of valid numbers if `$compare` supports it.
*
* Default empty.
*
* @var int|int[]
* @phpstan-var int<1,7>|array<int, int<1,7>>
*/
public $dayofweek;
/**
* The day number of the week (ISO). Accepts numbers 1-7
* (1 is Monday) or an array of valid numbers if `$compare` supports it.
*
* Default empty.
*
* @var int|int[]
* @phpstan-var int<1,7>|array<int, int<1,7>>
*/
public $dayofweek_iso;
/**
* The hour of the day. Accepts numbers 0-23 or an array
* of valid numbers if `$compare` supports it.
*
* Default empty.
*
* @var int|int[]
* @phpstan-var int<1,23>|array<int, int<1,23>>
*/
public $hour;
/**
* The minute of the hour. Accepts numbers 0-59 or an array
* of valid numbers if `$compare` supports it.
*
* Default empty.
*
* @var int|int[]
* @phpstan-var int<0,59>|array<int, int<0,59>>
*/
public $minute;
/**
* The second of the minute. Accepts numbers 0-59 or an
* array of valid numbers if `$compare` supports it.
*
* Default empty.
*
* @var int|int[]
* @phpstan-var int<0,59>|array<int, int<0,59>>
*/
public $second;
}

View File

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace Args\DateQuery;
/**
* Arguments for any query class that supports date queries.
*/
trait ProvidesArgs {
/**
* A `Query` object representing the `WP_Date_Query` constructor argument.
*/
public Query $date_query;
public function setDateQuery( Query $date_query ) : void {
$this->date_query = $date_query;
}
}

View File

@ -0,0 +1,100 @@
<?php
declare(strict_types=1);
namespace Args\DateQuery;
use Args\Arrayable\Arrayable;
/**
* Structure for a `date_query` argument.
*/
final class Query implements Arrayable, Values {
/**
* The column to query against.
*
* If undefined, inherits the value of the `$default_column` parameter. See WP_Date_Query::validate_column() and the 'date_query_valid_columns' filter for the list of accepted values.
*
* Default 'post_date'.
*/
public string $column;
/**
* The comparison operator.
*
* Accepts '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'.
*
* Default '='.
*
* @phpstan-var Values::DATE_QUERY_COMPARE_*
*/
public string $compare;
/**
* The MySQL keyword used to join the clauses of the query. Accepts 'AND' or 'OR'.
*
* Default 'AND'.
*
* @phpstan-var Values::DATE_QUERY_RELATION_*
*/
public string $relation;
/**
* @var array<int, Clause>
*/
public array $clauses;
/**
* @param mixed[] $clauses
* @return static
*/
final public static function fromArray( array $clauses ) : self {
$class = new static();
foreach ( $clauses as $key => $value ) {
if ( 'column' === $key ) {
$class->column = $value;
} elseif ( 'compare' === $key ) {
$class->compare = $value;
} elseif ( 'relation' === $key ) {
$class->relation = $value;
} else {
$class->addClause( Clause::fromArray( $value ) );
}
}
return $class;
}
final public function addClause( Clause $clause ) : void {
$this->clauses[] = $clause;
}
/**
* @return ?array<string|int,mixed>
*/
final public function toArray() :? array {
if ( ! isset( $this->clauses ) || count( $this->clauses ) === 0 ) {
return null;
}
$vars = [];
if ( isset( $this->column ) ) {
$vars['column'] = $this->column;
}
if ( isset( $this->compare ) ) {
$vars['compare'] = $this->compare;
}
if ( isset( $this->relation ) ) {
$vars['relation'] = $this->relation;
}
foreach ( $this->clauses as $key => $value ) {
$vars[ $key ] = $value->toArray();
}
return $vars;
}
}

View File

@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Args\DateQuery;
/**
* Argument values for any query class that supports date queries.
*/
interface Values {
public const DATE_QUERY_RELATION_AND = 'AND';
public const DATE_QUERY_RELATION_OR = 'OR';
public const DATE_QUERY_COMPARE_EQUALS = '=';
public const DATE_QUERY_COMPARE_NOT_EQUALS = '!=';
public const DATE_QUERY_COMPARE_GREATER_THAN = '>';
public const DATE_QUERY_COMPARE_GREATER_THAN_OR_EQUALS = '>=';
public const DATE_QUERY_COMPARE_LESS_THAN = '<';
public const DATE_QUERY_COMPARE_LESS_THAN_OR_EQUALS = '<=';
public const DATE_QUERY_COMPARE_IN = 'IN';
public const DATE_QUERY_COMPARE_NOT_IN = 'NOT IN';
public const DATE_QUERY_COMPARE_BETWEEN = 'BETWEEN';
public const DATE_QUERY_COMPARE_NOT_BETWEEN = 'NOT BETWEEN';
}

View File

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace Args\DateQuery;
/**
* Methods for any query class that supports date queries.
*/
interface WithArgs {
public function setDateQuery( Query $tax_query ) : void;
}

View File

@ -0,0 +1,62 @@
<?php
declare(strict_types=1);
namespace Args\MetaQuery;
use Args\Arrayable\Arrayable;
/**
* Arguments for a clause within a meta query, for example those within a `$meta_query` argument.
*/
final class Clause implements Arrayable, Values {
use \Args\Arrayable\ProvidesFromArray;
use \Args\Arrayable\ProvidesToArray;
/**
* Meta key or keys to filter by.
*
* @var string|array<int,string>
*/
public $key;
/**
* Meta value or values to filter by.
*
* @var string|array<int,string>
*/
public $value;
/**
* MySQL operator used for comparing the meta value.
*
* Default is 'IN' when `value` is an array, '=' otherwise.
*
* @phpstan-var Values::META_COMPARE_VALUE_*
*/
public string $compare;
/**
* MySQL operator used for comparing the meta key.
*
* Default is 'IN' when `key` is an array, '=' otherwise.
*
* @phpstan-var Values::META_COMPARE_KEY_*
*/
public string $compare_key;
/**
* MySQL data type that the `meta_value` column will be CAST to for comparisons.
*
* @phpstan-var Values::META_TYPE_VALUE_*
*/
public string $type;
/**
* MySQL data type that the `meta_key` column will be CAST to for comparisons.
*
* @phpstan-var Values::META_TYPE_KEY_*
*/
public string $type_key;
}

View File

@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
namespace Args\MetaQuery;
/**
* Arguments for any query class that supports meta queries.
*/
trait ProvidesArgs {
/**
* Meta key or keys to filter by.
*
* @var string|array<int,string>
*/
public $meta_key;
/**
* Meta value or values to filter by.
*
* @var string|array<int,string>
*/
public $meta_value;
/**
* MySQL operator used for comparing the meta value.
*
* Default is 'IN' when `meta_value` is an array, '=' otherwise.
*
* @phpstan-var Values::META_COMPARE_VALUE_*
*/
public string $meta_compare;
/**
* MySQL operator used for comparing the meta key.
*
* Default is 'IN' when `meta_key` is an array, '=' otherwise.
*
* @phpstan-var Values::META_COMPARE_KEY_*
*/
public string $meta_compare_key;
/**
* MySQL data type that the `meta_value` column will be CAST to for comparisons.
*
* @phpstan-var Values::META_TYPE_VALUE_*
*/
public string $meta_type;
/**
* MySQL data type that the `meta_key` column will be CAST to for comparisons.
*
* @phpstan-var Values::META_TYPE_KEY_*
*/
public string $meta_type_key;
/**
* A `Query` object representing the `WP_Meta_Query` constructor argument.
*/
public Query $meta_query;
public function setMetaQuery( Query $meta_query ) : void {
$this->meta_query = $meta_query;
}
}

View File

@ -0,0 +1,76 @@
<?php
declare(strict_types=1);
namespace Args\MetaQuery;
use Args\Arrayable\Arrayable;
/**
* Structure for a `meta_query` argument.
*/
final class Query implements Arrayable, Values {
/**
* The MySQL keyword used to join the clauses of the query. Accepts 'AND' or 'OR'.
*
* Default 'AND'.
*
* @phpstan-var Values::META_QUERY_RELATION_*
*/
public string $relation;
/**
* @var array<int|string, Clause>
*/
public array $clauses;
/**
* @param mixed[] $clauses
* @return static
*/
final public static function fromArray( array $clauses ) : self {
$class = new static();
foreach ( $clauses as $key => $value ) {
if ( 'relation' === $key ) {
$class->relation = $value;
} elseif ( is_string( $key ) ) {
$class->addClause( Clause::fromArray( $value ), $key );
} else {
$class->addClause( Clause::fromArray( $value ) );
}
}
return $class;
}
final public function addClause( Clause $clause, string $key = null ) : void {
if ( null !== $key ) {
$this->clauses[ $key ] = $clause;
} else {
$this->clauses[] = $clause;
}
}
/**
* @return ?array<string|int,mixed>
*/
final public function toArray() :? array {
if ( ! isset( $this->clauses ) || count( $this->clauses ) === 0 ) {
return null;
}
$vars = [];
if ( isset( $this->relation ) ) {
$vars['relation'] = $this->relation;
}
foreach ( $this->clauses as $key => $value ) {
$vars[ $key ] = $value->toArray();
}
return $vars;
}
}

View File

@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace Args\MetaQuery;
/**
* Argument values for any query class that supports meta queries.
*/
interface Values {
public const META_COMPARE_KEY_EQUALS = '=';
public const META_COMPARE_KEY_NOT_EQUALS = '!=';
public const META_COMPARE_KEY_LIKE = 'LIKE';
public const META_COMPARE_KEY_NOT_LIKE = 'NOT LIKE';
public const META_COMPARE_KEY_IN = 'IN';
public const META_COMPARE_KEY_NOT_IN = 'NOT IN';
public const META_COMPARE_KEY_REGEXP = 'REGEXP';
public const META_COMPARE_KEY_NOT_REGEXP = 'NOT REGEXP';
public const META_COMPARE_KEY_RLIKE = 'RLIKE';
public const META_COMPARE_KEY_EXISTS = 'EXISTS';
public const META_COMPARE_KEY_NOT_EXISTS = 'NOT EXISTS';
public const META_COMPARE_VALUE_EQUALS = '=';
public const META_COMPARE_VALUE_NOT_EQUALS = '!=';
public const META_COMPARE_VALUE_GREATER_THAN = '>';
public const META_COMPARE_VALUE_GREATER_THAN_OR_EQUALS = '>=';
public const META_COMPARE_VALUE_LESS_THAN = '<';
public const META_COMPARE_VALUE_LESS_THAN_OR_EQUALS = '<=';
public const META_COMPARE_VALUE_LIKE = 'LIKE';
public const META_COMPARE_VALUE_NOT_LIKE = 'NOT LIKE';
public const META_COMPARE_VALUE_IN = 'IN';
public const META_COMPARE_VALUE_NOT_IN = 'NOT IN';
public const META_COMPARE_VALUE_BETWEEN = 'BETWEEN';
public const META_COMPARE_VALUE_NOT_BETWEEN = 'NOT BETWEEN';
public const META_COMPARE_VALUE_REGEXP = 'REGEXP';
public const META_COMPARE_VALUE_NOT_REGEXP = 'NOT REGEXP';
public const META_COMPARE_VALUE_RLIKE = 'RLIKE';
public const META_COMPARE_VALUE_EXISTS = 'EXISTS';
public const META_COMPARE_VALUE_NOT_EXISTS = 'NOT EXISTS';
public const META_TYPE_KEY_NONE = '';
public const META_TYPE_KEY_BINARY = 'BINARY';
public const META_TYPE_VALUE_NUMERIC = 'NUMERIC';
public const META_TYPE_VALUE_BINARY = 'BINARY';
public const META_TYPE_VALUE_CHAR = 'CHAR';
public const META_TYPE_VALUE_DATE = 'DATE';
public const META_TYPE_VALUE_DATETIME = 'DATETIME';
public const META_TYPE_VALUE_DECIMAL = 'DECIMAL';
public const META_TYPE_VALUE_SIGNED = 'SIGNED';
public const META_TYPE_VALUE_TIME = 'TIME';
public const META_TYPE_VALUE_UNSIGNED = 'UNSIGNED';
public const META_QUERY_RELATION_AND = 'AND';
public const META_QUERY_RELATION_OR = 'OR';
}

View File

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace Args\MetaQuery;
/**
* Methods for any query class that supports meta queries.
*/
interface WithArgs {
public function setMetaQuery( Query $meta_query ) : void;
}

View File

@ -0,0 +1,85 @@
<?php
declare(strict_types=1);
namespace Args\Shared;
use Args\Arrayable\Arrayable;
/**
* @implements \ArrayAccess<string, mixed>
* @implements \IteratorAggregate<string, mixed>
*/
abstract class Base implements \ArrayAccess, \Countable, \IteratorAggregate, Arrayable {
public const ORDER_ASC = 'ASC';
public const ORDER_DESC = 'DESC';
use \Args\Arrayable\ProvidesFromArray;
use \Args\Arrayable\ProvidesToArray;
final public function __construct() {
if ( $this instanceof \Args\DateQuery\WithArgs ) {
$this->setDateQuery( new \Args\DateQuery\Query );
}
if ( $this instanceof \Args\MetaQuery\WithArgs ) {
$this->setMetaQuery( new \Args\MetaQuery\Query );
}
if ( $this instanceof \Args\TaxQuery\WithArgs ) {
$this->setTaxQuery( new \Args\TaxQuery\Query );
}
}
/**
* @param mixed $offset
*/
#[\ReturnTypeWillChange]
final public function offsetExists( $offset ) : bool {
if ( ! is_string( $offset ) ) {
return false;
}
return array_key_exists( $offset, get_object_vars( $this ) );
}
/**
* @param mixed $offset
* @return mixed
*/
#[\ReturnTypeWillChange]
final public function offsetGet( $offset ) {
if ( ! is_string( $offset ) ) {
return null;
}
if ( ! array_key_exists( $offset, get_object_vars( $this ) ) ) {
return null;
}
return $this->$offset;
}
/**
* @param mixed $offset
* @param mixed $value
*/
#[\ReturnTypeWillChange]
final public function offsetSet( $offset, $value ) : void {
$this->$offset = $value;
}
/**
* @param mixed $offset
*/
#[\ReturnTypeWillChange]
final public function offsetUnset( $offset ) : void {
unset( $this->$offset );
}
final public function count() : int {
return count( $this->toArray() );
}
final public function getIterator() : \Traversable {
return new \ArrayIterator( $this->toArray() );
}
}

View File

@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
namespace Args\TaxQuery;
use Args\Arrayable\Arrayable;
/**
* Arguments for a clause within a taxonomy query, for example those within a `$tax_query` argument.
*/
final class Clause implements Arrayable, Values {
use \Args\Arrayable\ProvidesFromArray;
use \Args\Arrayable\ProvidesToArray;
/**
* Taxonomy being queried. Optional when field=term_taxonomy_id.
*/
public string $taxonomy;
/**
* Term or terms to filter by.
*
* @var string|int|array<int,string>|array<int,int>
*/
public $terms;
/**
* Field to match `$terms` against. Accepts:
*
* - 'term_id'
* - 'slug'
* - 'name'
* - 'term_taxonomy_id'
*
* Default: 'term_id'.
*
* @phpstan-var 'term_id'|'slug'|'name'|'term_taxonomy_id'
*/
public string $field;
/**
* MySQL operator to be used with $terms in the WHERE clause.
*
* Accepts:
*
* - 'AND'
* - 'IN'
* - 'NOT IN'
* - 'EXISTS'
* - 'NOT EXISTS'
*
* Default: 'IN'.
*
* @phpstan-var Values::TAX_QUERY_OPERATOR_*
*/
public string $operator;
/**
* Whether to include child terms. Requires a `$taxonomy`.
*
* Default: true.
*/
public bool $children;
}

View File

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace Args\TaxQuery;
/**
* Arguments for any query class that supports taxonomy queries.
*/
trait ProvidesArgs {
/**
* A `Query` object representing the `WP_Tax_Query` constructor argument.
*/
public Query $tax_query;
public function setTaxQuery( Query $tax_query ) : void {
$this->tax_query = $tax_query;
}
}

View File

@ -0,0 +1,70 @@
<?php
declare(strict_types=1);
namespace Args\TaxQuery;
use Args\Arrayable\Arrayable;
/**
* Structure for a `tax_query` argument.
*/
final class Query implements Arrayable, Values {
/**
* The MySQL keyword used to join the clauses of the query. Accepts 'AND' or 'OR'.
*
* Default 'AND'.
*
* @phpstan-var Values::TAX_QUERY_RELATION_*
*/
public string $relation;
/**
* @var array<int, Clause>
*/
public array $clauses;
/**
* @param mixed[] $clauses
* @return static
*/
final public static function fromArray( array $clauses ) : self {
$class = new static();
foreach ( $clauses as $key => $value ) {
if ( 'relation' === $key ) {
$class->relation = $value;
} else {
$class->addClause( Clause::fromArray( $value ) );
}
}
return $class;
}
final public function addClause( Clause $clause ) : void {
$this->clauses[] = $clause;
}
/**
* @return ?array<string|int,mixed>
*/
final public function toArray() :? array {
if ( ! isset( $this->clauses ) || count( $this->clauses ) === 0 ) {
return null;
}
$vars = [];
if ( isset( $this->relation ) ) {
$vars['relation'] = $this->relation;
}
foreach ( $this->clauses as $key => $value ) {
$vars[ $key ] = $value->toArray();
}
return $vars;
}
}

View File

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace Args\TaxQuery;
/**
* Argument values for any query class that supports taxonomy queries.
*/
interface Values {
public const TAX_QUERY_RELATION_AND = 'AND';
public const TAX_QUERY_RELATION_OR = 'OR';
public const TAX_QUERY_OPERATOR_AND = 'AND';
public const TAX_QUERY_OPERATOR_IN = 'IN';
public const TAX_QUERY_OPERATOR_NOT_IN = 'NOT IN';
public const TAX_QUERY_OPERATOR_EXISTS = 'EXISTS';
public const TAX_QUERY_OPERATOR_NOT_EXISTS = 'NOT EXISTS';
}

View File

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace Args\TaxQuery;
/**
* Methods for any query class that supports taxonomy queries.
*/
interface WithArgs {
public function setTaxQuery( Query $tax_query ) : void;
}

View File

@ -0,0 +1,240 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `WP_Block_Type` class in WordPress.
*
* @link https://developer.wordpress.org/reference/classes/WP_Block_Type/
*/
class WP_Block_Type extends Shared\Base {
/**
* Block API version.
*/
public int $api_version;
/**
* Human-readable block type label.
*/
public string $title;
/**
* Block type category classification, used in search interfaces to arrange block types by category.
*/
public string $category;
/**
* Setting parent lets a block require that it is only available when nested within the specified blocks.
*
* @var array<int, string>
*/
public array $parent;
/**
* Setting ancestor makes a block available only inside the specified block types at any position of the ancestor's block subtree.
*
* @var array<int, string>
*/
public array $ancestor;
/**
* Block type icon.
*/
public string $icon;
/**
* A detailed block type description.
*/
public string $description;
/**
* Additional keywords to produce block type as result in search interfaces.
*
* @var array<int, string>
*/
public array $keywords;
/**
* The translation textdomain.
*/
public string $textdomain;
/**
* Alternative block styles.
*
* @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/
*
* @var array<int, array<string, mixed>>
* @phpstan-var array<int, array{
* name: string,
* label: string,
* inline_style?: string,
* style_handle?: string,
* is_default?: bool,
* }>
*/
public array $styles;
/**
* Supported features.
*
* @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/
*
* @var array<string,mixed>
*/
public array $supports;
/**
* Structured data for the block preview.
*
* @var array<string, array<string, mixed>>
*/
public array $example;
/**
* Block type render callback.
*
* @var callable
* @phpstan-var callable( array<string, mixed>, string, \WP_Block= ): string
*/
public $render_callback;
/**
* Block type attributes property schemas.
*
* @var array<string, array<string, mixed>>
*/
public array $attributes;
/**
* Context values inherited by blocks of this type.
*
* @var array<int, string>
*/
public array $uses_context;
/**
* Context provided by blocks of this type.
*
* @var array<string, string>
*/
public array $provides_context;
/**
* Block hooks.
*
* @var array<string, string>
* @phpstan-var array<string, 'before'|'after'|'first_child'|'last_child'>
*/
public array $block_hooks;
/**
* Limits which block types can be inserted as children of this block type
*
* @var array<int, string>
* @phpstan-var list<string>
*/
public array $allowed_blocks;
/**
* Block type variations callback.
*
* @var callable
* @phpstan-var callable(): list<array<string, mixed>>
*/
public $variation_callback;
/**
* Block type front end only style handles.
*
* @var array<int, string>
* @phpstan-var list<string>
*/
public array $view_style_handles;
/**
* Block type editor script handle.
*
* @deprecated WordPress 6.1.0
*/
public string $editor_script;
/**
* Block type editor only script handles.
*
* @var array<int, string>
*/
public array $editor_script_handles;
/**
* Block type front end script handle.
*
* @deprecated WordPress 6.1.0
*/
public string $script;
/**
* Block type front end and editor script handles.
*
* @var array<int, string>
*/
public array $script_handles;
/**
* Custom CSS selectors for theme.json style generation.
*
* @var array<string, mixed>
*/
public array $selectors;
/**
* Block type editor style handle.
*
* @deprecated WordPress 6.1.0
*/
public string $editor_style;
/**
* Block type editor only style handles.
*
* @var array<int, string>
*/
public array $editor_style_handles;
/**
* Block type front end style handle.
*
* @deprecated WordPress 6.1.0
*/
public string $style;
/**
* Block type front end and editor style handles.
*
* @var array<int, string>
*/
public array $style_handles;
/**
* Block type front end only script handle.
*
* @deprecated WordPress 6.1.0
*/
public string $view_script;
/**
* Block type front end only script handles.
*
* @var array<int, string>
*/
public array $view_script_handles;
/**
* Block variations.
*
* @var array<int, array<string, mixed>>
*/
public array $variations;
}

View File

@ -0,0 +1,385 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `WP_Comment_Query::__construct()` method in WordPress.
*
* @link https://developer.wordpress.org/reference/classes/wp_comment_query/__construct/
*/
class WP_Comment_Query extends Shared\Base implements DateQuery\WithArgs, MetaQuery\WithArgs {
public const FIELD_IDS = 'ids';
public const FIELD_ALL = '';
public const HIERARCHICAL_FALSE = false;
public const HIERARCHICAL_THREADED = 'threaded';
public const HIERARCHICAL_FLAT = 'flat';
use DateQuery\ProvidesArgs;
use MetaQuery\ProvidesArgs;
/**
* Comment author email address.
*
* Default empty.
*/
public string $author_email;
/**
* Comment author URL.
*
* Default empty.
*/
public string $author_url;
/**
* Array of author IDs to include comments for.
*
* Default empty.
*
* @var array<int,int>
*/
public array $author__in;
/**
* Array of author IDs to exclude comments for.
*
* Default empty.
*
* @var array<int,int>
*/
public array $author__not_in;
/**
* Array of comment IDs to include.
*
* Default empty.
*
* @var array<int,int>
*/
public array $comment__in;
/**
* Array of comment IDs to exclude.
*
* Default empty.
*
* @var array<int,int>
*/
public array $comment__not_in;
/**
* Whether to return a comment count (true) or array of comment objects (false).
*
* Default false.
*/
public bool $count;
/**
* Comment fields to return. Accepts 'ids' for comment IDs only or empty for all fields.
*
* Default empty.
*
* @phpstan-var self::FIELD_*
*/
public string $fields;
/**
* Array of IDs or email addresses of users whose unapproved comments will be returned by the query regardless of `$status`.
*
* Default empty.
*
* @var array<int,(int|string)>
*/
public array $include_unapproved;
/**
* Karma score to retrieve matching comments for.
*
* Default empty.
*/
public int $karma;
/**
* Maximum number of comments to retrieve.
*
* Default empty (no limit).
*/
public int $number;
/**
* When used with `$number`, defines the page of results to return. When used with `$offset`, `$offset` takes precedence.
*
* Default 1.
*/
public int $paged;
/**
* Number of comments to offset the query. Used to build `LIMIT` clause.
*
* Default 0.
*/
public int $offset;
/**
* Whether to disable the `SQL_CALC_FOUND_ROWS` query.
*
* Default: true.
*/
public bool $no_found_rows;
/**
* Field(s) to order comments by. To use 'meta_value' or 'meta_value_num', `$meta_key` must also be defined. To sort by a specific `$meta_query` clause, use that clause's array key. Accepts:
*
* - 'comment_agent'
* - 'comment_approved'
* - 'comment_author'
* - 'comment_author_email'
* - 'comment_author_IP'
* - 'comment_author_url'
* - 'comment_content'
* - 'comment_date'
* - 'comment_date_gmt'
* - 'comment_ID'
* - 'comment_karma'
* - 'comment_parent'
* - 'comment_post_ID'
* - 'comment_type'
* - 'user_id'
* - 'comment__in'
* - 'meta_value'
* - 'meta_value_num'
* - the value of `$meta_key`
* - the array keys of `$meta_query`
* - an empty array or 'none' to disable `ORDER BY` clause.
*
* Default: 'comment_date_gmt'.
*
* @var string|array<int,string>
*/
public $orderby;
/**
* How to order retrieved comments. Accepts 'ASC', 'DESC'.
*
* Default: 'DESC'.
*
* @phpstan-var Shared\Base::ORDER_*
*/
public string $order;
/**
* Parent ID of comment to retrieve children of.
*
* Default empty.
*/
public int $parent;
/**
* Array of parent IDs of comments to retrieve children for.
*
* Default empty.
*
* @var array<int,int>
*/
public array $parent__in;
/**
* Array of parent IDs of comments *not* to retrieve children for.
*
* Default empty.
*
* @var array<int,int>
*/
public array $parent__not_in;
/**
* Array of author IDs to retrieve comments for.
*
* Default empty.
*
* @var array<int,int>
*/
public array $post_author__in;
/**
* Array of author IDs *not* to retrieve comments for.
*
* Default empty.
*
* @var array<int,int>
*/
public array $post_author__not_in;
/**
* Limit results to those affiliated with a given post ID.
*
* Default 0.
*/
public int $post_id;
/**
* Array of post IDs to include affiliated comments for.
*
* Default empty.
*
* @var array<int,int>
*/
public array $post__in;
/**
* Array of post IDs to exclude affiliated comments for.
*
* Default empty.
*
* @var array<int,int>
*/
public array $post__not_in;
/**
* Post author ID to limit results by.
*
* Default empty.
*/
public int $post_author;
/**
* Post status or array of post statuses to retrieve affiliated comments for. Pass 'any' to match any value.
*
* Default empty.
*
* @var string|array<int,string>
*/
public $post_status;
/**
* Post type or array of post types to retrieve affiliated comments for. Pass 'any' to match any value.
*
* Default empty.
*
* @var string|array<int,string>
*/
public $post_type;
/**
* Post name to retrieve affiliated comments for.
*
* Default empty.
*/
public string $post_name;
/**
* Post parent ID to retrieve affiliated comments for.
*
* Default empty.
*/
public int $post_parent;
/**
* Search term(s) to retrieve matching comments for.
*
* Default empty.
*/
public string $search;
/**
* Comment statuses to limit results by. Accepts an array or space/comma-separated list of:
*
* - 'hold' (`comment_status=0`)
* - 'approve' (`comment_status=1`)
* - 'all'
* - a custom comment status
*
* Default 'all'.
*
* @var string|array<int,string>
*/
public $status;
/**
* Include comments of a given type, or array of types. Accepts:
*
* - 'comment'
* - 'pings' (includes 'pingback' and 'trackback')
* - any custom type string
*
* Default empty.
*
* @var string|array<int,string>
*/
public $type;
/**
* Include comments from a given array of comment types.
*
* Default empty.
*
* @var array<int,string>
*/
public array $type__in;
/**
* Exclude comments from a given array of comment types.
*
* Default empty.
*
* @var array<int,string>
*/
public array $type__not_in;
/**
* Include comments for a specific user ID.
*
* Default empty.
*/
public int $user_id;
/**
* Whether to include comment descendants in the results.
*
* - 'threaded' returns a tree, with each comment's children stored in a `children` property on the `WP_Comment` object.
* - 'flat' returns a flat array of found comments plus their children.
* - Boolean `false` leaves out descendants.
*
* The parameter is ignored (forced to `false`) when `$fields` is 'ids' or 'counts'.
*
* Default: false.
*
* @var false|string
* @phpstan-var self::HIERARCHICAL_*
*/
public $hierarchical;
/**
* Unique cache key to be produced when this query is stored in an object cache.
*
* Default is 'core'.
*/
public string $cache_domain;
/**
* Whether to prime the metadata cache for found comments.
*
* Default true.
*/
public bool $update_comment_meta_cache;
/**
* Whether to prime the cache for comment posts.
*
* Default false.
*/
public bool $update_comment_post_cache;
/**
* Currently unused.
*/
protected int $ID;
/**
* Currently unused.
*/
protected int $post_ID;
}

View File

@ -0,0 +1,130 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `WP_Customize_Control::__construct()` method in WordPress.
*
* @link https://developer.wordpress.org/reference/classes/wp_customize_control/__construct/
* @link https://developer.wordpress.org/themes/customize-api/customizer-objects/
*/
class WP_Customize_Control extends Shared\Base {
/**
* Order in which this instance was created in relation to other instances.
*/
public int $instance_number;
/**
* Customizer bootstrap instance.
*/
public \WP_Customize_Manager $manager;
/**
* Control ID.
*/
public string $id;
/**
* All settings tied to the control.
*
* If undefined, `$id` will be used.
*
* @var array<string, mixed>
*/
public array $settings;
/**
* The primary setting for the control (if there is one).
*
* Default 'default'.
*/
public string $setting;
/**
* Capability required to use this control.
*
* Normally this is empty and the capability is derived from `$settings`.
*/
public string $capability;
/**
* Order priority to load the control.
*
* Default 10.
*/
public int $priority;
/**
* Section the control belongs to.
*
* Default empty.
*/
public string $section;
/**
* Label for the control.
*
* Default empty.
*/
public string $label;
/**
* Description for the control.
*
* Default empty.
*/
public string $description;
/**
* List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values.
*
* Default empty array.
*
* @var array<string, string>
*/
public array $choices;
/**
* List of custom input attributes for control output, where attribute names are the keys and values are the values.
*
* Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types.
*
* Default empty array.
*
* @var array<string, string>
*/
public array $input_attrs;
/**
* Show UI for adding new content, currently only used for the dropdown-pages control.
*
* Default false.
*/
public bool $allow_addition;
/**
* Deprecated. Use `WP_Customize_Control::json()` instead.
*
* @var array<string, mixed>
*/
protected array $json;
/**
* Control type.
*
* Core controls include 'text', 'checkbox', 'textarea', 'radio', 'select', and 'dropdown-pages'. Additional input types such as 'email', 'url', 'number', 'hidden', and 'date' are supported implicitly.
*
* Default 'text'.
*/
public string $type;
/**
* Active callback.
*
* @var callable
* @phpstan-var callable(\WP_Customize_Control): bool
*/
public $active_callback;
}

View File

@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `WP_Customize_Manager::__construct()` method in WordPress.
*
* @link https://developer.wordpress.org/reference/classes/wp_customize_manager/__construct/
* @link https://developer.wordpress.org/themes/customize-api/customizer-objects/
*/
class WP_Customize_Manager extends Shared\Base {
/**
* Changeset UUID, the `post_name` for the customize_changeset post containing the customized state.
*
* Defaults to `null` resulting in a UUID to be immediately generated. If `false` is provided, then then the changeset UUID will be determined during `after_setup_theme`: when the `customize_changeset_branching` filter returns false, then the default UUID will be that of the most recent `customize_changeset` post that has a status other than 'auto-draft', 'publish', or 'trash'. Otherwise, if changeset branching is enabled, then a random UUID will be used.
*
* @var null|string|false
*/
public $changeset_uuid;
/**
* Theme to be previewed (for theme switch).
*
* Defaults to customize_theme or theme query params.
*/
public string $theme;
/**
* Messenger channel.
*
* Defaults to customize_messenger_channel query param.
*/
public string $messenger_channel;
/**
* If settings should be previewed.
*
* Defaults to true.
*/
public bool $settings_previewed;
/**
* If changeset branching is allowed; otherwise, changesets are linear.
*
* Defaults to true.
*/
public bool $branching;
/**
* If data from a changeset's autosaved revision should be loaded if it exists.
*
* Defaults to false.
*/
public bool $autosaved;
}

View File

@ -0,0 +1,55 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `WP_Customize_Panel::__construct()` method in WordPress.
*
* @link https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/
* @link https://developer.wordpress.org/themes/customize-api/customizer-objects/
*/
class WP_Customize_Panel extends Shared\Base {
/**
* Priority of the panel, defining the display order of panels and sections. Default 160.
*/
public int $priority;
/**
* Capability required for the panel. Default `edit_theme_options`.
*/
public string $capability;
/**
* Theme features required to support the panel.
*
* @var string|array<int, mixed>
* @phpstan-var string|array{
* 0: string,
* }
*/
public $theme_supports;
/**
* Title of the panel to show in UI.
*/
public string $title;
/**
* Description to show in the UI.
*/
public string $description;
/**
* Type of the panel.
*/
public string $type;
/**
* Active callback.
*
* @phpstan-var callable(\WP_Customize_Panel): bool
*/
public $active_callback;
}

View File

@ -0,0 +1,73 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `WP_Customize_Section::__construct()` method in WordPress.
*
* @link https://developer.wordpress.org/reference/classes/wp_customize_section/__construct/
* @link https://developer.wordpress.org/themes/customize-api/customizer-objects/
*/
class WP_Customize_Section extends Shared\Base {
/**
* Priority of the section, defining the display order of panels and sections.
*
* Default 160.
*/
public int $priority;
/**
* The panel this section belongs to (if any).
*
* Default empty.
*/
public string $panel;
/**
* Capability required for the section.
*
* Default 'edit_theme_options'
*/
public string $capability;
/**
* Theme features required to support the section.
*
* @var string|array<int, mixed>
* @phpstan-var string|array{
* 0: string,
* }
*/
public $theme_supports;
/**
* Title of the section to show in UI.
*/
public string $title;
/**
* Description to show in the UI.
*/
public string $description;
/**
* Type of the section.
*/
public string $type;
/**
* Active callback.
*
* @phpstan-var callable(\WP_Customize_Section): bool
*/
public $active_callback;
/**
* Hide the description behind a help icon, instead of inline above the first control.
*
* Default false.
*/
public bool $description_hidden;
}

View File

@ -0,0 +1,87 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `WP_Customize_Setting::__construct()` method in WordPress.
*
* @link https://developer.wordpress.org/reference/classes/wp_customize_setting/__construct/
* @link https://developer.wordpress.org/themes/customize-api/customizer-objects/
*/
class WP_Customize_Setting extends Shared\Base {
public const TRANSPORT_REFRESH = 'refresh';
public const TRANSPORT_POSTMESSAGE = 'postMessage';
/**
* Type of the setting.
*
* Default 'theme_mod'.
*/
public string $type;
/**
* Capability required for the setting.
*
* Default 'edit_theme_options'
*/
public string $capability;
/**
* Theme features required to support the setting.
*
* @var string|array<int, mixed>
* @phpstan-var string|array{
* 0: string,
* }
*/
public $theme_supports;
/**
* Default value for the setting.
*
* Default is empty string.
*/
public string $default;
/**
* Options for rendering the live preview of changes in Customizer.
*
* Using 'refresh' makes the change visible by reloading the whole preview. Using 'postMessage' allows a custom JavaScript to handle live changes.
*
* Default is 'refresh'.
*
* @phpstan-var self::TRANSPORT_*
*/
public string $transport;
/**
* Server-side validation callback for the setting's value.
*
* @var callable
* @phpstan-var callable(\WP_Error, mixed, \WP_Customize_Setting): \WP_Error
*/
public $validate_callback;
/**
* Callback to filter a Customize setting value in un-slashed form.
*
* @var callable
* @phpstan-var callable(mixed, \WP_Customize_Setting): mixed
*/
public $sanitize_callback;
/**
* Callback to convert a Customize PHP setting value to a value that is JSON serializable.
*
* @var callable
* @phpstan-var callable(mixed, \WP_Customize_Setting): mixed
*/
public $sanitize_js_callback;
/**
* Whether or not the setting is initially dirty when created.
*/
public bool $dirty;
}

165
vendor/johnbillion/args/src/WP_Http.php vendored Normal file
View File

@ -0,0 +1,165 @@
<?php
declare(strict_types=1);
namespace Args;
use WP_Http_Cookie;
/**
* Arguments for the `WP_Http::request()` method in WordPress.
*
* @link https://developer.wordpress.org/reference/classes/wp_http/request/
*/
class WP_Http extends Shared\Base {
public const METHOD_GET = 'GET';
public const METHOD_POST = 'POST';
public const METHOD_HEAD = 'HEAD';
public const METHOD_PUT = 'PUT';
public const METHOD_DELETE = 'DELETE';
public const METHOD_TRACE = 'TRACE';
public const METHOD_OPTIONS = 'OPTIONS';
public const METHOD_PATCH = 'PATCH';
/** @var array<string, string> */
protected array $map = [
'user_agent' => 'user-agent',
];
/**
* Request method.
*
* Some transports technically allow others, but should not be assumed.
*
* Default 'GET'.
*
* @phpstan-var self::METHOD_*
*/
public string $method;
/**
* How long the connection should stay open in seconds.
*
* Default 5.
*/
public float $timeout;
/**
* Number of allowed redirects. Not supported by all transports.
*
* Default 5.
*/
public int $redirection;
/**
* Version of the HTTP protocol to use.
*
* Accepts '1.0' and '1.1'.
*
* Default '1.0'.
*/
public string $httpversion;
/**
* User-agent value sent.
*
* Default `'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' )`.
*/
public string $user_agent;
/**
* Whether to pass URLs through `wp_http_validate_url()`.
*
* Default false.
*/
public bool $reject_unsafe_urls;
/**
* Whether the calling code requires the result of the request.
*
* If set to false, the request will be sent to the remote server, and processing returned to the calling code immediately, the caller will know if the request succeeded or failed, but will not receive any response from the remote server.
*
* Default true.
*/
public bool $blocking;
/**
* Array of headers to send with the request.
*
* Default empty array.
*
* @var array<string,string>
*/
public array $headers;
/**
* List of cookies to send with the request.
*
* Default empty array.
*
* @var string[]|WP_Http_Cookie[]
*/
public array $cookies;
/**
* Body to send with the request.
*
* Default null.
*
* @var string|mixed[]
*/
public $body;
/**
* Whether to compress the $body when sending the request.
*
* Default false.
*/
public bool $compress;
/**
* Whether to decompress a compressed response.
*
* If set to false and compressed content is returned in the response anyway, it will need to be separately decompressed.
*
* Default true.
*/
public bool $decompress;
/**
* Whether to verify SSL for the request.
*
* Default true.
*/
public bool $sslverify;
/**
* Absolute path to an SSL certificate `.crt` file.
*
* Default `ABSPATH . WPINC . '/certificates/ca-bundle.crt'`.
*/
public string $sslcertificates;
/**
* Whether to stream to a file.
*
* If set to true and no filename was given, it will be dropped it in the WP temp dir and its name will be set using the basename of the URL.
*
* Default false.
*/
public bool $stream;
/**
* Filename of the file to write to when streaming. `$stream` must be set to true.
*
* Default null.
*/
public string $filename;
/**
* Size in bytes to limit the response to.
*
* Default null.
*/
public int $limit_response_size;
}

527
vendor/johnbillion/args/src/WP_Query.php vendored Normal file
View File

@ -0,0 +1,527 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `WP_Query` class in WordPress.
*
* @link https://developer.wordpress.org/reference/classes/wp_query/parse_query/
*/
class WP_Query extends Shared\Base implements DateQuery\WithArgs, MetaQuery\WithArgs, TaxQuery\WithArgs {
public const COMMENT_STATUS_OPEN = 'open';
public const COMMENT_STATUS_CLOSED = 'closed';
public const FIELD_ALL = '';
public const FIELD_IDS = 'ids';
public const FIELD_ID_PARENT = 'id=>parent';
public const PERM_READABLE = 'readable';
public const PERM_EDITABLE = 'editable';
public const COMMENT_COUNT_COMPARE_EQUALS = '=';
public const COMMENT_COUNT_COMPARE_NOT_EQUALS = '!=';
public const COMMENT_COUNT_COMPARE_GREATER_THAN = '>';
public const COMMENT_COUNT_COMPARE_GREATER_THAN_OR_EQUALS = '>=';
public const COMMENT_COUNT_COMPARE_LESS_THAN = '<';
public const COMMENT_COUNT_COMPARE_LESS_THAN_OR_EQUALS = '<=';
use DateQuery\ProvidesArgs;
use MetaQuery\ProvidesArgs;
use TaxQuery\ProvidesArgs;
/**
* Attachment post ID. Used for 'attachment' post_type.
*/
public int $attachment_id;
/**
* Author ID, or comma-separated list of IDs.
*
* @var int|string
*/
public $author;
/**
* User 'user_nicename'.
*/
public string $author_name;
/**
* An array of author IDs to query from.
*
* @var array<int, int>
*/
public array $author__in;
/**
* An array of author IDs not to query from.
*
* @var array<int, int>
*/
public array $author__not_in;
/**
* Whether to cache post information.
*
* Default true.
*/
public bool $cache_results;
/**
* Category ID or comma-separated list of IDs (this or any children).
*
* @var int|string
*/
public $cat;
/**
* An array of category IDs (AND in).
*
* @var array<int, int>
*/
public array $category__and;
/**
* An array of category IDs (OR in, no children).
*
* @var array<int, int>
*/
public array $category__in;
/**
* An array of category IDs (NOT in).
*
* @var array<int, int>
*/
public array $category__not_in;
/**
* Use category slug (not name, this or any children).
*/
public string $category_name;
/**
* Filter results by comment count.
*
* Provide an integer to match comment count exactly. Provide an array with integer 'value' and 'compare' operator ('=', '!=', '>', '>=', '<', '<=' ) to compare against comment_count in a specific way.
*
* @var array<string,(int|string)>|int
* @phpstan-var array{
* value: int,
* compare: self::COMMENT_COUNT_COMPARE_*,
* }|int
*/
public $comment_count;
/**
* Comment status.
*
* @phpstan-var self::COMMENT_STATUS_*
*/
public string $comment_status;
/**
* The number of comments to return per page.
*
* Default 'comments_per_page' option.
*/
public int $comments_per_page;
/**
* Day of the month.
*
* Default empty. Accepts numbers 1-31.
*
* @phpstan-var int<1, 31>
*/
public int $day;
/**
* Whether to search by exact keyword.
*
* Default false.
*/
public bool $exact;
/**
* Post fields to query for.
*
* Accepts:
*
* - '' Returns an array of complete post objects (`WP_Post[]`).
* - 'ids' Returns an array of post IDs (`int[]`).
* - 'id=>parent' Returns an associative array of parent post IDs, keyed by post ID (`int[]`).
*
* Default ''.
*
* @phpstan-var self::FIELD_*
*/
public string $fields;
/**
* Hour of the day.
*
* Default empty. Accepts numbers 0-23.
*
* @phpstan-var int<0, 23>
*/
public int $hour;
/**
* Whether to ignore sticky posts or not. Setting this to false excludes stickies from 'post__in'.
*
* Default false.
*/
public bool $ignore_sticky_posts;
/**
* Combination YearMonth. Accepts any four-digit year and month numbers 1-12.
*
* Default empty.
*/
public int $m;
/**
* The menu order of the posts.
*/
public int $menu_order;
/**
* Second of the minute.
*
* Default empty. Accepts numbers 0-59.
*
* @phpstan-var int<0, 59>
*/
public int $minute;
/**
* The two-digit month.
*
* Default empty. Accepts numbers 1-12.
*
* @phpstan-var int<1, 12>
*/
public int $monthnum;
/**
* Post slug.
*/
public string $name;
/**
* Show all posts (true) or paginate (false).
*
* Default false.
*/
public bool $nopaging;
/**
* Whether to skip counting the total rows found. Enabling can improve performance.
*
* Default false.
*/
public bool $no_found_rows;
/**
* The number of posts to offset before retrieval.
*/
public int $offset;
/**
* Designates ascending or descending order of posts.
*
* Default 'DESC'. Accepts 'ASC', 'DESC'.
*
* @phpstan-var Shared\Base::ORDER_*
*/
public string $order;
/**
* Sort retrieved posts by parameter. One or more options may be passed.
*
* To use 'meta_value', or 'meta_value_num', 'meta_key=keyname' must be also be defined. To sort by a specific `$meta_query` clause, use that clause's array key.
*
* Accepts:
*
* - 'none'
* - 'name'
* - 'author'
* - 'date'
* - 'title'
* - 'modified'
* - 'menu_order'
* - 'parent'
* - 'ID'
* - 'rand'
* - 'relevance'
* - 'RAND(x)' (where 'x' is an integer seed value)
* - 'comment_count'
* - 'meta_value'
* - 'meta_value_num'
* - 'post__in'
* - 'post_name__in'
* - 'post_parent__in'
* - The array keys of `$meta_query`
*
* Default is 'date', except when a search is being performed, when the default is 'relevance'.
*
* @var string|array<int,string>
*/
public $orderby;
/**
* Post ID.
*/
public int $p;
/**
* Show the number of posts that would show up on page X of a static front page.
*/
public int $page;
/**
* The number of the current page.
*/
public int $paged;
/**
* Page ID.
*/
public int $page_id;
/**
* Page slug.
*/
public string $pagename;
/**
* Show posts if user has the appropriate capability.
*
* @phpstan-var self::PERM_*
*/
public string $perm;
/**
* Ping status.
*
* @phpstan-var self::COMMENT_STATUS_*
*/
public string $ping_status;
/**
* An array of post IDs to retrieve, sticky posts will be included.
*
* @var array<int, int>
*/
public array $post__in;
/**
* An array of post IDs not to retrieve.
*
* @var array<int, int>
*/
public array $post__not_in;
/**
* The mime type of the post. Used for 'attachment' post_type.
*/
public string $post_mime_type;
/**
* An array of post slugs that results must match.
*
* @var array<int, string>
*/
public array $post_name__in;
/**
* Page ID to retrieve child pages for. Use 0 to only retrieve top-level pages.
*/
public int $post_parent;
/**
* An array containing parent page IDs to query child pages from.
*
* @var array<int, int>
*/
public array $post_parent__in;
/**
* An array containing parent page IDs not to query child pages from.
*
* @var array<int, int>
*/
public array $post_parent__not_in;
/**
* A post type slug (string) or array of post type slugs.
*
* Default 'any' if using 'tax_query'.
*
* @var string|array<int, string>
*/
public $post_type;
/**
* A post status (string) or array of post statuses.
*
* @var string|array<int, string>
*/
public $post_status;
/**
* The number of posts to query for. Use -1 to request all posts.
*
* @phpstan-var positive-int | -1
*/
public int $posts_per_page;
/**
* The number of posts to query for by archive page. Overrides 'posts_per_page' when is_archive(), or is_search() are true.
*
* @phpstan-var positive-int | -1
*/
public int $posts_per_archive_page;
/**
* Search keyword(s).
*
* Prepending a term with a hyphen will exclude posts matching that term. Eg, 'pillow -sofa' will return posts containing 'pillow' but not 'sofa'.
*
* The character used for exclusion can be modified using the the 'wp_query_search_exclusion_prefix' filter.
*/
public string $s;
/**
* Array of column names to be searched.
*
* Accepts 'post_title', 'post_excerpt', and 'post_content'.
*
* Default empty array.
*
* @var array<int, string>
* @phpstan-var list<'post_title'|'post_excerpt'|'post_content'>
*/
public array $search_columns;
/**
* Second of the minute.
*
* Default empty. Accepts numbers 0-59.
*
* @phpstan-var int<0, 59>
*/
public int $second;
/**
* Whether to search by phrase.
*
* Default false.
*/
public bool $sentence;
/**
* Whether to suppress filters.
*
* Default false.
*/
public bool $suppress_filters;
/**
* Tag slug. Comma-separated (either), Plus-separated (all).
*/
public string $tag;
/**
* An array of tag IDs (AND in).
*
* @var array<int, int>
*/
public array $tag__and;
/**
* An array of tag IDs (OR in).
*
* @var array<int, int>
*/
public array $tag__in;
/**
* An array of tag IDs (NOT in).
*
* @var array<int, int>
*/
public array $tag__not_in;
/**
* Tag id or comma-separated list of IDs.
*/
public int $tag_id;
/**
* An array of tag slugs (AND in).
*
* @var array<int, string>
*/
public array $tag_slug__and;
/**
* An array of tag slugs (OR in). unless 'ignore_sticky_posts' is true.
*
* @var array<int, string>
*/
public array $tag_slug__in;
/**
* Post title.
*/
public string $title;
/**
* Whether to update the post meta cache.
*
* Default true.
*/
public bool $update_post_meta_cache;
/**
* Whether to update the post term cache.
*
* Default true.
*/
public bool $update_post_term_cache;
/**
* Whether to update the menu item cache.
*
* Default true.
*/
public bool $update_menu_item_cache;
/**
* Whether to lazy-load term meta. Setting to false will disable cache priming for term meta, so that each get_term_meta() call will hit the database.
*
* Defaults to the value of `$update_post_term_cache`.
*/
public bool $lazy_load_term_meta;
/**
* The week number of the year.
*
* Default empty. Accepts numbers 0-53.
*
* @phpstan-var int<0, 53>
*/
public int $w;
/**
* The four-digit year.
*
* Default empty. Accepts any four-digit year.
*/
public int $year;
}

View File

@ -0,0 +1,245 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `WP_Term_Query` class in WordPress.
*
* @link https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
*/
class WP_Term_Query extends Shared\Base implements MetaQuery\WithArgs {
public const FIELD_ALL = 'all';
public const FIELD_ALL_WITH_OBJECT_ID = 'all_with_object_id';
public const FIELD_IDS = 'ids';
public const FIELD_TT_IDS = 'tt_ids';
public const FIELD_NAMES = 'names';
public const FIELD_SLUGS = 'slugs';
public const FIELD_COUNT = 'count';
public const FIELD_ID_PARENT = 'id=>parent';
public const FIELD_ID_NAME = 'id=>name';
public const FIELD_ID_SLUG = 'id=>slug';
use MetaQuery\ProvidesArgs;
/**
* Taxonomy name, or array of taxonomies, to which results should be limited.
*
* @var string|array<int,string>
*/
public $taxonomy;
/**
* Object ID, or array of object IDs. Results will be limited to terms associated with these objects.
*
* @var int|array<int,int>
*/
public $object_ids;
/**
* Field(s) to order terms by.
*
* Accepts:
*
* - Term fields ('name', 'slug', 'term_group', 'term_id', 'id',
* 'description', 'parent', 'term_order'). Unless `$object_ids`
* is not empty, 'term_order' is treated the same as 'term_id'.
* - 'count' to use the number of objects associated with the term.
* - 'include' to match the 'order' of the $include param.
* - 'slug__in' to match the 'order' of the $slug param.
* - 'meta_value', 'meta_value_num'.
* - The value of `$meta_key`.
* - The array keys of `$meta_query`.
* - 'none' to omit the ORDER BY clause.
*
* Default 'name'.
*/
public string $orderby;
/**
* Whether to order terms in ascending or descending order. Accepts 'ASC' (ascending) or 'DESC' (descending).
*
* Default 'ASC'.
*
* @phpstan-var Shared\Base::ORDER_*
*/
public string $order;
/**
* Whether to hide terms not assigned to any posts.
*
* Default true.
*/
public bool $hide_empty;
/**
* Array of term IDs to include.
*
* @var array<int,int>
*/
public array $include;
/**
* Array of term IDs to exclude. If `$include` is non-empty, `$exclude` is ignored.
*
* @var array<int,int>
*/
public array $exclude;
/**
* Array of term IDs to exclude along with all of their descendant terms. If `$include` is non-empty, `$exclude_tree` is ignored.
*
* @var array<int,int>
*/
public array $exclude_tree;
/**
* Maximum number of terms to return. Accepts 0 (all) or any positive number.
*
* Note that `$number` may not return accurate results when coupled with `$object_ids`. See #41796 for details.
*
* Default 0 (all).
*
* @phpstan-var positive-int | 0
*/
public int $number;
/**
* The number by which to offset the terms query.
*
* @phpstan-var positive-int | 0
*/
public int $offset;
/**
* Term fields to query for.
*
* Accepts:
*
* - 'all' Returns an array of complete term objects (`WP_Term[]`).
* - 'all_with_object_id' Returns an array of term objects
* with the 'object_id' param (`WP_Term[]`). Works only
* when the `$object_ids` parameter is populated.
* - 'ids' Returns an array of term IDs (`int[]`).
* - 'tt_ids' Returns an array of term taxonomy IDs (`int[]`).
* - 'names' Returns an array of term names (`string[]`).
* - 'slugs' Returns an array of term slugs (`string[]`).
* - 'count' Returns the number of matching terms (`int`).
* - 'id=>parent' Returns an associative array of parent term IDs,
* keyed by term ID (`int[]`).
* - 'id=>name' Returns an associative array of term names,
* keyed by term ID (`string[]`).
* - 'id=>slug' Returns an associative array of term slugs,
* keyed by term ID (`string[]`).
*
* Default 'all'.
*
* @phpstan-var self::FIELD_*
*/
public string $fields;
/**
* Whether to return a term count. If true, will take precedence over `$fields`.
*
* Default false.
*/
public bool $count;
/**
* Name or array of names to return term(s) for.
*
* @var string|array<int,string>
*/
public $name;
/**
* Slug or array of slugs to return term(s) for.
*
* @var string|array<int,string>
*/
public $slug;
/**
* Term taxonomy ID, or array of term taxonomy IDs, to match when querying terms.
*
* @var int|array<int,int>
*/
public $term_taxonomy_id;
/**
* Whether to include terms that have non-empty descendants (even if `$hide_empty` is set to true).
*
* Default true.
*/
public bool $hierarchical;
/**
* Search criteria to match terms. Will be SQL-formatted with wildcards before and after.
*/
public string $search;
/**
* Retrieve terms with criteria by which a term is LIKE `$name__like`.
*/
public string $name__like;
/**
* Retrieve terms where the description is LIKE `$description__like`.
*/
public string $description__like;
/**
* Whether to pad the quantity of a term's children in the quantity of each term's "count" object variable.
*
* Default false.
*/
public bool $pad_counts;
/**
* Whether to return terms regardless of ancestry or whether the terms are empty. Accepts 'all' or empty (disabled).
*
* Default ''.
*
* @phpstan-var 'all' | ''
*/
public string $get;
/**
* Term ID to retrieve child terms of. If multiple taxonomies are passed, `$child_of` is ignored.
*/
public int $child_of;
/**
* Parent term ID to retrieve direct-child terms of.
*/
public int $parent;
/**
* True to limit results to terms that have no children. This parameter has no effect on non-hierarchical taxonomies.
*
* Default false.
*/
public bool $childless;
/**
* Unique cache key to be produced when this query is stored in an object cache.
*
* Default 'core'.
*/
public string $cache_domain;
/**
* Whether to cache term information.
*
* Default true.
*/
public bool $cache_results;
/**
* Whether to prime meta caches for matched terms.
*
* Default true.
*/
public bool $update_term_meta_cache;
}

View File

@ -0,0 +1,292 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `WP_User_Query::prepare_query()` method in WordPress.
*
* @link https://developer.wordpress.org/reference/classes/wp_user_query/prepare_query/
*/
class WP_User_Query extends Shared\Base implements MetaQuery\WithArgs {
public const FIELD_ID = 'ID';
public const FIELD_LOGIN = 'user_login';
public const FIELD_EMAIL = 'user_email';
public const FIELD_URL = 'user_url';
public const FIELD_NICENAME = 'user_nicename';
public const FIELD_DISPLAY_NAME = 'display_name';
public const FIELD_REGISTERED = 'user_registered';
public const SEARCH_COLUMN_ID = self::FIELD_ID;
public const SEARCH_COLUMN_LOGIN = self::FIELD_LOGIN;
public const SEARCH_COLUMN_EMAIL = self::FIELD_EMAIL;
public const SEARCH_COLUMN_URL = self::FIELD_URL;
public const SEARCH_COLUMN_NICENAME = self::FIELD_NICENAME;
public const SEARCH_COLUMN_DISPLAY_NAME = self::FIELD_DISPLAY_NAME;
public const WHO_ALL = '';
public const WHO_AUTHORS = 'authors';
use MetaQuery\ProvidesArgs;
/**
* The site ID.
*
* Default is the current site.
*/
public int $blog_id;
/**
* An array or a comma-separated list of role names that users must match to be included in results. Note that this is an inclusive list: users must match *each* role.
*
* Default empty.
*
* @var string|array<int,string>
*/
public $role;
/**
* An array of role names. Matched users must have at least one of these roles.
*
* Default empty array.
*
* @var array<int,string>
*/
public array $role__in;
/**
* An array of role names to exclude. Users matching one or more of these roles will not be included in results.
*
* Default empty array.
*
* @var array<int,string>
*/
public array $role__not_in;
/**
* An array of user IDs to include.
*
* Default empty array.
*
* @var array<int,int>
*/
public array $include;
/**
* An array of user IDs to exclude.
*
* Default empty array.
*
* @var array<int,int>
*/
public array $exclude;
/**
* Search keyword. Searches for possible string matches on columns. When `$search_columns` is left empty, it tries to determine which column to search in based on search string.
*
* Default empty.
*/
public string $search;
/**
* Array of column names to be searched. Accepts 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename', 'display_name'.
*
* Default empty array.
*
* @var array<int,string>
* @phpstan-var array<int,self::SEARCH_COLUMN_*>
*/
public array $search_columns;
/**
* Field(s) to sort the retrieved users by.
*
* May be a single value, an array of values, or a multi-dimensional array with fields as keys and orders ('ASC' or 'DESC') as values. Accepted values are:
*
* - 'ID', 'display_name' (or 'name')
* - 'include'
* - 'user_login' (or 'login')
* - 'login__in'
* - 'user_nicename' (or 'nicename')
* - 'nicename__in'
* - 'user_email (or 'email')
* - 'user_url' (or 'url')
* - 'user_registered' (or 'registered')
* - 'post_count'
* - 'meta_value'
* - 'meta_value_num'
* - the value of `$meta_key`
* - or an array key of `$meta_query`.
*
* To use 'meta_value' or 'meta_value_num', `$meta_key` must be also be defined.
*
* Default 'user_login'.
*
* @var string|mixed[]
*/
public $orderby;
/**
* Designates ascending or descending order of users. Order values passed as part of an `$orderby` array take precedence over this parameter. Accepts 'ASC', 'DESC'.
*
* Default 'ASC'.
*
* @phpstan-var Shared\Base::ORDER_*
*/
public string $order;
/**
* Number of users to offset in retrieved results. Can be used in conjunction with pagination.
*
* Default 0.
*/
public int $offset;
/**
* Number of users to limit the query for. Can be used in conjunction with pagination. Value -1 (all) is supported, but should be used with caution on larger sites.
*
* Default -1 (all users).
*/
public int $number;
/**
* When used with number, defines the page of results to return.
*
* Default 1.
*/
public int $paged;
/**
* Whether to count the total number of users found. If pagination is not needed, setting this to false can improve performance.
*
* Default true.
*/
public bool $count_total;
/**
* Which fields to return. Single or all fields (string), or array of fields.
*
* Accepts:
*
* - 'ID'
* - 'display_name'
* - 'user_login'
* - 'user_nicename'
* - 'user_email'
* - 'user_url'
* - 'user_registered'
*
* Use 'all' for all fields and 'all_with_meta' to include meta fields.
*
* Default 'all'.
*
* @var string|array<int, string>
* @phpstan-var (self::FIELD_*|'all'|'all_with_meta')|array<int,(self::FIELD_*)>
*/
public $fields;
/**
* Type of users to query. Accepts 'authors'.
*
* Default empty (all users).
*
* @phpstan-var self::WHO_*
*/
public string $who;
/**
* Pass an array of post types to filter results to users who have published posts in those post types.
*
* `true` is an alias for all public post types.
*
* @var true|array<int,string>
*/
public $has_published_posts;
/**
* The user nicename.
*
* Default empty.
*/
public string $nicename;
/**
* An array of nicenames to include. Users matching one of these nicenames will be included in results.
*
* Default empty array.
*
* @var array<int,string>
*/
public array $nicename__in;
/**
* An array of nicenames to exclude. Users matching one of these nicenames will not be included in results.
*
* Default empty array.
*
* @var array<int,string>
*/
public array $nicename__not_in;
/**
* The user login.
*
* Default empty.
*/
public string $login;
/**
* An array of logins to include. Users matching one of these logins will be included in results.
*
* Default empty array.
*
* @var array<int,string>
*/
public array $login__in;
/**
* An array of logins to exclude. Users matching one of these logins will not be included in results.
*
* Default empty array.
*
* @var array<int,string>
*/
public array $login__not_in;
/**
* Whether to cache user information.
*
* Default true.
*/
public bool $cache_results;
/**
* An array or a comma-separated list of capability names that users must match to be included in results.
*
* Note that this is an inclusive list: users must match *each* capability.
*
* Does NOT work for capabilities not in the database or filtered via {@see 'map_meta_cap'}.
*
* @var string|array<int,string>
*/
public $capability;
/**
* An array of capability names. Matched users must have at least one of these capabilities.
*
* Does NOT work for capabilities not in the database or filtered via {@see 'map_meta_cap'}.
*
* @var array<int,string>
*/
public array $capability__in;
/**
* An array of capability names to exclude. Users matching one or more of these capabilities will not be included in results.
*
* Does NOT work for capabilities not in the database or filtered via {@see 'map_meta_cap'}.
*
* @var array<int,string>
*/
public array $capability__not_in;
}

View File

@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `get_categories()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/get_categories/
* @link https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
*/
class get_categories extends WP_Term_Query {}

View File

@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `get_comments()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/get_comments/
* @link https://developer.wordpress.org/reference/classes/wp_comment_query/__construct/
*/
class get_comments extends WP_Comment_Query {}

View File

@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `get_posts()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/get_posts/
* @link https://developer.wordpress.org/reference/classes/wp_query/parse_query/
*/
class get_posts extends WP_Query {
/**
* Total number of posts to retrieve. Is an alias of `$posts_per_page` in `WP_Query`.
*
* Accepts -1 for all.
*
* Default 5.
*
* @phpstan-var positive-int|-1
*/
public int $numberposts;
/**
* Category ID or comma-separated list of IDs (this or any children). Is an alias of `$cat` in `WP_Query`.
*
* Default 0.
*
* @var int|string
*/
public $category;
/**
* An array of post IDs to retrieve, sticky posts will be included. Is an alias of `$post__in` in `WP_Query`.
*
* Default empty array.
*
* @var array<int, int>
*/
public array $include;
/**
* An array of post IDs not to retrieve.
*
* Default empty array.
*
* @var array<int, int>
*/
public array $exclude;
/**
* Whether to suppress filters.
*
* Default true.
*/
public bool $suppress_filters;
}

View File

@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `get_tags()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/get_tags/
* @link https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
*/
class get_tags extends WP_Term_Query {}

View File

@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `get_terms()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/get_terms/
* @link https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
*/
class get_terms extends WP_Term_Query {}

View File

@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `get_users()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/get_users/
* @link https://developer.wordpress.org/reference/classes/wp_user_query/prepare_query/
*/
class get_users extends WP_User_Query {}

View File

@ -0,0 +1,128 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `paginate_links()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/paginate_links/
*/
class paginate_links extends Shared\Base {
/**
* Base of the paginated url.
*
* Default empty.
*/
public string $base;
/**
* Format for the pagination structure.
*
* Default empty.
*/
public string $format;
/**
* The total amount of pages.
*
* Default is the value WP_Query's `max_num_pages` or 1.
*/
public int $total;
/**
* The current page number.
*
* Default is 'paged' query var or 1.
*/
public int $current;
/**
* The value for the aria-current attribute. Possible values are 'page', 'step', 'location', 'date', 'time', 'true', 'false'.
*
* Default is 'page'.
*
* @phpstan-var 'page'|'step'|'location'|'date'|'time'|'true'|'false'
*/
public string $aria_current;
/**
* Whether to show all pages.
*
* Default false.
*/
public bool $show_all;
/**
* How many numbers on either the start and the end list edges.
*
* Default 1.
*/
public int $end_size;
/**
* How many numbers to either side of the current pages.
*
* Default 2.
*/
public int $mid_size;
/**
* Whether to include the previous and next links in the list.
*
* Default true.
*/
public bool $prev_next;
/**
* The previous page text.
*
* Default '&laquo; Previous'.
*/
public string $prev_text;
/**
* The next page text.
*
* Default 'Next &raquo;'.
*/
public string $next_text;
/**
* Controls format of the returned value. Possible values are 'plain', 'array' and 'list'.
*
* Default is 'plain'.
*/
public string $type;
/**
* An array of query args to add.
*
* Default false.
*
* @var mixed[]
*/
public array $add_args;
/**
* A string to append to each link.
*
* Default empty.
*/
public string $add_fragment;
/**
* A string to appear before the page number.
*
* Default empty.
*/
public string $before_page_number;
/**
* A string to append after the page number.
*
* Default empty.
*/
public string $after_page_number;
}

View File

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `register_block_type` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/register_block_type/
*/
class register_block_type extends WP_Block_Type {}

View File

@ -0,0 +1,92 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `register_meta()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/register_meta/
*/
class register_meta extends Shared\Base {
public const TYPE_STRING = 'string';
public const TYPE_BOOLEAN = 'boolean';
public const TYPE_INTEGER = 'integer';
public const TYPE_NUMBER = 'number';
public const TYPE_ARRAY = 'array';
public const TYPE_OBJECT = 'object';
/**
* A subtype; e.g. if the object type is "post", the post type.
*
* If left empty, the meta key will be registered on the entire object type.
*
* Default empty.
*/
public string $object_subtype;
/**
* The type of data associated with this meta key.
*
* Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'.
*
* @phpstan-var self::TYPE_*
*/
public string $type;
/**
* A description of the data attached to this meta key.
*/
public string $description;
/**
* Whether the meta key has one value per object, or an array of values per object.
*/
public bool $single;
/**
* The default value returned from `get_metadata()` if no value has been set yet.
*
* When using a non-single meta key, the default value is for the first entry. In other words, when calling `get_metadata()` with `$single` set to `false`, the default value given here will be wrapped in an array.
*
* @var mixed
*/
public $default;
/**
* A function or method to call when sanitizing `$meta_key` data.
*
* @var callable
* @phpstan-var (callable(mixed,string,string,string): mixed)|(callable(mixed,string,string): mixed)
*/
public $sanitize_callback;
/**
* A function or method to call when performing `edit_post_meta`, `add_post_meta`, and `delete_post_meta` capability checks.
*
* @var callable
* @phpstan-var (callable(bool,string,string,string): bool)|(callable(bool,string,string): bool)
*/
public $auth_callback;
/**
* Whether data associated with this meta key can be considered public and should be accessible via the REST API.
*
* A custom post type must also declare support for custom fields for registered meta to be accessible via REST. When registering complex meta values this argument may optionally be an array with 'schema' or 'prepare_callback' keys instead of a boolean.
*
* @var bool|array<string, mixed>
* @phpstan-var bool|array{
* schema: array<string,mixed>,
* prepare_callback: callable(mixed,\WP_REST_Request,array<string,mixed>): mixed,
* }
*/
public $show_in_rest;
/**
* Whether to enable revisions support for this meta_key.
*
* Can only be used when the object type is 'post'.
*/
public bool $revisions_enabled;
}

View File

@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `register_post_meta()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/register_post_meta/
* @link https://developer.wordpress.org/reference/functions/register_meta/
*/
class register_post_meta extends register_meta {}

View File

@ -0,0 +1,98 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `register_post_status()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/register_post_status/
*/
class register_post_status extends Shared\Base {
/**
* A descriptive name for the post status marked for translation.
*
* Defaults to value of `$post_status`.
*/
public string $label;
/**
* Descriptive text to use for nooped plurals.
*
* Default array of `$label`, twice.
*
* @var mixed[]
*/
public array $label_count;
/**
* Whether to exclude posts with this post status from search results.
*
* Default is value of `$internal`.
*/
public bool $exclude_from_search;
/**
* FOR INTERNAL USE ONLY! Whether the status is built-in.
*
* Default false.
*/
protected bool $_builtin;
/**
* Whether posts of this status should be shown in the front end of the site.
*
* Default false.
*/
public bool $public;
/**
* Whether the status is for internal use only.
*
* Default false.
*/
public bool $internal;
/**
* Whether posts with this status should be protected.
*
* Default false.
*/
public bool $protected;
/**
* Whether posts with this status should be private.
*
* Default false.
*/
public bool $private;
/**
* Whether posts with this status should be publicly-queryable.
*
* Default is value of `$public`.
*/
public bool $publicly_queryable;
/**
* Whether to include posts in the edit listing for their post type.
*
* Default is the opposite value of `$internal`.
*/
public bool $show_in_admin_all_list;
/**
* Show in the list of statuses with post counts at the top of the edit listings, e.g. All (12) | Published (9) | My Custom Status (2)
*
* Default is the opposite value of `$internal`.
*/
public bool $show_in_admin_status_list;
/**
* Whether the post has a floating creation date.
*
* Default `false`.
*/
public bool $date_floating;
}

View File

@ -0,0 +1,381 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `register_post_type()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/register_post_type/
*/
class register_post_type extends Shared\Base {
public const TEMPLATE_LOCK_ALL = 'all';
public const TEMPLATE_LOCK_INSERT = 'insert';
public const TEMPLATE_LOCK_FALSE = false;
/**
* Name of the post type shown in the menu. Usually plural.
*
* Default is value of `$labels['name']`.
*/
public string $label;
/**
* An array of labels for this post type.
*
* If not set, post labels are inherited for non-hierarchical types and page labels for hierarchical ones.
*
* See `get_post_type_labels()` for a full list of supported labels.
*
* @var array<string,string>
*/
public array $labels;
/**
* A short descriptive summary of what the post type is.
*
* Default empty.
*/
public string $description;
/**
* Whether a post type is intended for use publicly either via the admin interface or by front-end users.
*
* While the default settings of `$exclude_from_search`, `$publicly_queryable`, `$show_ui`, and `$show_in_nav_menus`
* are inherited from `$public`, each does not rely on this relationship and controls a very specific intention.
*
* Default false.
*/
public bool $public;
/**
* Whether the post type is hierarchical (e.g. page).
*
* Default false.
*/
public bool $hierarchical;
/**
* Whether to exclude posts with this post type from front end search results.
*
* Default is the opposite value of `$public`.
*/
public bool $exclude_from_search;
/**
* Whether queries can be performed on the front end for the post type as part of `parse_request()`.
*
* Endpoints would include:
*
* - `?post_type={post_type_key}`
* - `?{post_type_key}={single_post_slug}`
* - `?{post_type_query_var}={single_post_slug}`
*
* If not set, the default is inherited from `$public`.
*/
public bool $publicly_queryable;
/**
* Whether to generate and allow a UI for managing this post type in the admin.
*
* Default is value of `$public`.
*/
public bool $show_ui;
/**
* Where to show the post type in the admin menu. To work, `$show_ui` must be true.
*
* - If true the post type is shown in its own top level menu.
* - If false, no menu is shown.
* - If a string of an existing top level menu (eg. 'tools.php' or 'edit.php?post_type=page'), the post type will be placed as a sub-menu of that.
*
* Default is value of `$show_ui`.
*
* @var bool|string
*/
public $show_in_menu;
/**
* Makes this post type available for selection in navigation menus.
*
* Default is value of `$public`.
*/
public bool $show_in_nav_menus;
/**
* Makes this post type available via the admin bar.
*
* Default is value of `$show_in_menu`.
*/
public bool $show_in_admin_bar;
/**
* Whether to include the post type in the REST API.
*
* Set this to true for the post type to be available in the block editor.
*/
public bool $show_in_rest;
/**
* To change the base URL of REST API route.
*
* Default is `$post_type`.
*/
public string $rest_base;
/**
* To change the namespace URL of REST API route.
*
* Default is wp/v2.
*/
public string $rest_namespace;
/**
* REST API controller class name.
*
* Default is 'WP_REST_Posts_Controller'.
*
* @phpstan-var class-string<\WP_REST_Controller>
*/
public string $rest_controller_class;
/**
* REST API autosave controller class name.
*
* Default is 'WP_REST_Autosaves_Controller'.
*
* @phpstan-var class-string<\WP_REST_Controller>
*/
public string $autosave_rest_controller_class;
/**
* REST API revisions controller class name.
*
* Default is 'WP_REST_Revisions_Controller'.
*
* @phpstan-var class-string<\WP_REST_Controller>
*/
public string $revisions_rest_controller_class;
/**
* A flag to direct the REST API controllers for autosave / revisions should be registered before/after the post type controller.
*/
public bool $late_route_registration;
/**
* The position in the menu order the post type should appear. To work, `$show_in_menu` must be true.
*
* Default null (at the bottom).
*/
public int $menu_position;
/**
* The URL to the icon to be used for this menu.
*
* - Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme -- this should begin with `data:image/svg+xml;base64,`.
* - Pass the name of a Dashicons helper class to use a font icon, e.g. `dashicons-chart-pie`.
* - Pass `'none'` to leave `div.wp-menu-image` empty so an icon can be added via CSS.
*
* Defaults to use the posts icon.
*/
public string $menu_icon;
/**
* The strings to use to build the read, edit, and delete capabilities.
*
* Passed as an array to allow for alternative plurals when using this argument as a base to construct the capabilities, e.g. array('story', 'stories').
*
* Default [ 'post', 'posts' ].
*
* @var array<int,string>
* @phpstan-var array{
* 0: string,
* 1: string,
* }
*/
public array $capability_type;
/**
* Array of capabilities for this post type.
*
* `$capability_type` is used as a base to construct capabilities by default. See `get_post_type_capabilities()`.
*
* @var array<string,string>
* @phpstan-var array{
* edit_post?: string,
* read_post?: string,
* delete_post?: string,
* edit_posts?: string,
* edit_others_posts?: string,
* delete_posts?: string,
* publish_posts?: string,
* read_private_posts?: string,
* read?: string,
* delete_private_posts?: string,
* delete_published_posts?: string,
* delete_others_posts?: string,
* edit_private_posts?: string,
* edit_published_posts?: string,
* create_posts?: string,
* }
*/
public array $capabilities;
/**
* Whether to use the internal default meta capability handling.
*
* Default false.
*/
public bool $map_meta_cap;
/**
* Core feature(s) the post type supports. Serves as an alias for calling `add_post_type_support()` directly.
*
* Core features include:
*
* - 'title'
* - 'editor'
* - 'comments'
* - 'revisions'
* - 'trackbacks'
* - 'author'
* - 'excerpt'
* - 'page-attributes'
* - 'thumbnail'
* - 'custom-fields'
* - 'post-formats'
*
* Additionally, the 'revisions' feature dictates whether the post type will store revisions, and the 'comments'
* feature dictates whether the comments count will show on the edit screen. A feature can also be specified as
* an array of arguments to provide additional information about supporting that feature. Example:
*
* array( 'my_feature', array( 'field' => 'value' ) )
*
* Default is an array containing 'title' and 'editor'.
*
* @var array<int, (string|array<string, mixed>)>
*/
public array $supports;
/**
* Provide a callback function that sets up the meta boxes for the edit form.
*
* Do `remove_meta_box()` and `add_meta_box()` calls in the callback.
*
* Default null.
*
* @var callable
* @phpstan-var callable(\WP_Post): void
*/
public $register_meta_box_cb;
/**
* An array of taxonomy identifiers that will be registered for the post type.
*
* Taxonomies can be registered later with `register_taxonomy()` or `register_taxonomy_for_object_type()`.
*
* Default empty array.
*
* @var array<int,string>
*/
public array $taxonomies;
/**
* Whether there should be post type archives, or if a string, the archive slug to use.
*
* Will generate the proper rewrite rules if `$rewrite` is enabled.
*
* Default false.
*
* @var bool|string
*/
public $has_archive;
/**
* Triggers the handling of rewrites for this post type.
*
* To prevent rewrite, set to false.
*
* Defaults to true, using `$post_type` as slug. To specify rewrite rules,
* an array can be passed.
*
* @var bool|array<string,mixed>
* @phpstan-var bool|array{
* slug?: string,
* with_front?: bool,
* feeds?: bool,
* pages?: bool,
* ep_mask?: int,
* }
*/
public $rewrite;
/**
* Sets the query_var key for this post type.
*
* Defaults to `$post_type` key.
*
* - If false, a post type cannot be loaded at `?{query_var}={post_slug}`.
* - If specified as a string, the query `?{query_var_string}={post_slug}` will be valid.
*
* @var string|bool
*/
public $query_var;
/**
* Whether to allow this post type to be exported.
*
* Default true.
*/
public bool $can_export;
/**
* Whether to delete posts of this type when deleting a user.
*
* - If true, posts of this type belonging to the user will be moved to Trash when the user is deleted.
* - If false, posts of this type belonging to the user will *not* be trashed or deleted.
* - If not set (the default), posts are trashed if post type supports the 'author' feature. Otherwise posts are not trashed or deleted.
*
* Default null.
*/
public bool $delete_with_user;
/**
* Array of blocks to use as the default initial state for an editor session.
*
* Each item should be an array containing block name and optional attributes.
*
* Default empty array.
*
* @var array<int, array<int, string|array<string, mixed>>>
*/
public array $template;
/**
* Whether the block template should be locked if `$template` is set.
*
* - If set to 'all', the user is unable to insert new blocks, move existing blocks and delete blocks.
* - If set to 'insert', the user is able to move existing blocks but is unable to insert new blocks and delete blocks
*
* Default false.
*
* @var string|false
* @phpstan-var self::TEMPLATE_LOCK_*
*/
public $template_lock;
/**
* FOR INTERNAL USE ONLY! True if this post type is a native or "built-in" post_type.
*
* Default false.
*/
protected bool $_builtin;
/**
* FOR INTERNAL USE ONLY! URL segment to use for edit link of this post type.
*
* Default 'post.php?post=%d'.
*/
protected string $_edit_link;
}

View File

@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `register_rest_field()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/register_rest_field/
*/
class register_rest_field extends Shared\Base {
/**
* The callback function used to retrieve the field value.
*
* Default is 'null', the field will not be returned in the response. The function will be passed the prepared object data.
*
* @var callable
* @phpstan-var callable(mixed[],string,\WP_REST_Request): mixed
*/
public $get_callback;
/**
* The callback function used to set and update the field value.
*
* Default is 'null', the value cannot be set or updated. The function will be passed the model object, like `WP_Post`.
*
* @var callable
* @phpstan-var callable(mixed,object,string,\WP_REST_Request,string): mixed
*/
public $update_callback;
/**
* The schema for this field.
*
* Default is 'null', no schema entry will be returned.
*
* @var mixed[]
*/
public array $schema;
}

View File

@ -0,0 +1,205 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `register_taxonomy()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/register_taxonomy/
*/
class register_taxonomy extends Shared\Base {
/**
* An array of labels for this taxonomy. By default, Tag labels are used for non-hierarchical taxonomies, and Category labels are used for hierarchical taxonomies. See accepted values in `get_taxonomy_labels()`.
*
* Default empty array.
*
* @var array<string,string>
*/
public array $labels;
/**
* A short descriptive summary of what the taxonomy is for.
*
* Default empty.
*/
public string $description;
/**
* Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users. The default settings of `$publicly_queryable`, `$show_ui`, and `$show_in_nav_menus` are inherited from `$public`.
*/
public bool $public;
/**
* Whether the taxonomy is publicly queryable. If not set, the default is inherited from `$public`
*/
public bool $publicly_queryable;
/**
* Whether the taxonomy is hierarchical.
*
* Default false.
*/
public bool $hierarchical;
/**
* Whether to generate and allow a UI for managing terms in this taxonomy in the admin. If not set, the default is inherited from `$public` (default true).
*/
public bool $show_ui;
/**
* Whether to show the taxonomy in the admin menu. If true, the taxonomy is shown as a submenu of the object type menu. If false, no menu is shown. `$show_ui` must be true. If not set, default is inherited from `$show_ui` (default true).
*/
public bool $show_in_menu;
/**
* Makes this taxonomy available for selection in navigation menus. If not set, the default is inherited from `$public` (default true).
*/
public bool $show_in_nav_menus;
/**
* Whether to include the taxonomy in the REST API. Set this to true for the taxonomy to be available in the block editor.
*/
public bool $show_in_rest;
/**
* To change the base url of REST API route.
*
* Default is `$taxonomy`.
*/
public string $rest_base;
/**
* To change the namespace URL of REST API route.
*
* Default is wp/v2.
*/
public string $rest_namespace;
/**
* REST API Controller class name.
*
* Default is 'WP_REST_Terms_Controller'.
*
* @phpstan-var class-string<\WP_REST_Controller>
*/
public string $rest_controller_class;
/**
* Whether to list the taxonomy in the Tag Cloud Widget controls. If not set, the default is inherited from `$show_ui` (default true).
*/
public bool $show_tagcloud;
/**
* Whether to show the taxonomy in the quick/bulk edit panel. It not set, the default is inherited from `$show_ui` (default true).
*/
public bool $show_in_quick_edit;
/**
* Whether to display a column for the taxonomy on its post type listing screens.
*
* Default false.
*/
public bool $show_admin_column;
/**
* Provide a callback function for the meta box display. If not set, `post_categories_meta_box()` is used for hierarchical taxonomies, and `post_tags_meta_box()` is used for non-hierarchical. If false, no meta box is shown.
*
* @var false|callable
* @phpstan-var false|callable(\WP_Post,mixed[]): void
*/
public $meta_box_cb;
/**
* Callback function for sanitizing taxonomy data saved from a meta box. If no callback is defined, an appropriate one is determined based on the value of `$meta_box_cb`.
*
* @var callable
* @phpstan-var callable(string,mixed): (int|string)[]
*/
public $meta_box_sanitize_cb;
/**
* Array of capabilities for this taxonomy.
*
* @var array<string,string>
* @phpstan-var array{
* manage_terms: string,
* edit_terms: string,
* delete_terms: string,
* assign_terms: string,
* }
*/
public array $capabilities;
/**
* Triggers the handling of rewrites for this taxonomy.
*
* Default true, using `$taxonomy` as slug.
*
* To prevent rewrite, set to false. To specify rewrite rules, an array can be passed with any of these keys:
*
* @var bool|array<string,mixed>
* @phpstan-var bool|array{
* slug?: string,
* with_front?: bool,
* hierarchical?: bool,
* ep_mask?: int,
* }
*/
public $rewrite;
/**
* Sets the query var key for this taxonomy.
*
* Default `$taxonomy` key. If false, a taxonomy cannot be loaded at `?{query_var}={term_slug}`. If a string, the query `?{query_var}={term_slug}` will be valid.
*
* @var string|bool
*/
public $query_var;
/**
* Works much like a hook, in that it will be called when the count is updated.
*
* Default `_update_post_term_count()` for taxonomies attached to post types, which confirms that the objects are published before counting them.
*
* Default `_update_generic_term_count()` for taxonomies attached to other object types, such as users.
*
* @var callable
* @phpstan-var callable(int[],\WP_Taxonomy): void
*/
public $update_count_callback;
/**
* Default term to be used for the taxonomy.
*
* @var string|array<string,string>
* @phpstan-var string|array{
* name: string,
* slug?: string,
* description?: string,
* }
*/
public $default_term;
/**
* Whether terms in this taxonomy should be sorted in the order they are provided to `wp_set_object_terms()`.
*
* Default false.
*/
public bool $sort;
/**
* Array of arguments to automatically use inside `wp_get_object_terms()` for this taxonomy.
*
* @var array<string,mixed>
*/
public array $args;
/**
* FOR INTERNAL USE ONLY! True if this taxonomy is a native or "built-in" post_type.
*
* Default false.
*/
protected bool $_builtin;
}

View File

@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `register_term_meta()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/register_term_meta/
* @link https://developer.wordpress.org/reference/functions/register_meta/
*/
class register_term_meta extends register_meta {}

View File

@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `wp_count_terms()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/wp_count_terms/
* @link https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
*/
class wp_count_terms extends WP_Term_Query {}

76
vendor/johnbillion/args/src/wp_die.php vendored Normal file
View File

@ -0,0 +1,76 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `wp_die()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/wp_die/
*/
class wp_die extends Shared\Base {
/**
* The HTTP response code.
*
* Default 200 for Ajax requests, 500 otherwise.
*/
public int $response;
/**
* A URL to include a link to.
*
* Only works in combination with `$link_text`.
*
* Default empty string.
*/
public string $link_url;
/**
* A label for the link to include.
*
* Only works in combination with `$link_url`.
*
* Default empty string.
*/
public string $link_text;
/**
* Whether to include a link to go back.
*
* Default false.
*/
public bool $back_link;
/**
* The text direction.
*
* This is only useful internally, when WordPress is still loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
*
* Default is the value of is_rtl().
*
* @phpstan-var 'rtl'|'ltr'
*/
public string $text_direction;
/**
* Character set of the HTML output.
*
* Default 'utf-8'.
*/
public string $charset;
/**
* Error code to use.
*
* Default is 'wp_die', or the main error code if `$message` is a `WP_Error`.
*/
public string $code;
/**
* Whether to exit the process after completion.
*
* Default true.
*/
public bool $exit;
}

View File

@ -0,0 +1,123 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `wp_dropdown_categories()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/wp_dropdown_categories/
*/
class wp_dropdown_categories extends WP_Term_Query {
/**
* The 'id' of an element that contains descriptive text for the select.
*
* Default empty.
*/
public string $aria_describedby;
/**
* Text to display for showing all categories.
*
* Default empty.
*/
public string $show_option_all;
/**
* Text to display for showing no categories.
*
* Default empty.
*/
public string $show_option_none;
/**
* Value to use when no category is selected.
*
* Default empty.
*/
public string $option_none_value;
/**
* Whether to include post counts.
*
* Default false.
*/
public bool $show_count;
/**
* Whether to echo or return the generated markup.
*
* Default true.
*/
public bool $echo;
/**
* Maximum depth.
*
* Default 0.
*/
public int $depth;
/**
* Tab index for the select element.
*
* Default 0 (no tabindex).
*/
public int $tab_index;
/**
* Value for the 'id' attribute of the select element.
*
* Defaults to the value of `$name`.
*/
public string $id;
/**
* Value for the 'class' attribute of the select element.
*
* Default 'postform'.
*/
public string $class;
/**
* Value of the option that should be selected.
*
* Default 0.
*
* @var int|string
*/
public $selected;
/**
* Term field that should be used to populate the 'value' attribute of the option elements.
*
* Accepts any valid term field: 'term_id', 'name', 'slug', 'term_group', 'term_taxonomy_id', 'taxonomy', 'description', 'parent', 'count'.
*
* Default 'term_id'.
*/
public string $value_field;
/**
* True to skip generating markup if no categories are found.
*
* Default false (create select element even if no categories are found).
*/
public bool $hide_if_empty;
/**
* Whether the `<select>` element should have the HTML5 'required' attribute.
*
* Default false.
*/
public bool $required;
/**
* Walker object to use to build the output.
*
* Default empty which results in a `Walker_CategoryDropdown` instance being used.
*
* @var \Walker
*/
public $walker;
}

View File

@ -0,0 +1,86 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `wp_dropdown_languages()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/wp_dropdown_languages/
*/
class wp_dropdown_languages extends Shared\Base {
/**
* ID attribute of the select element.
*
* Default 'locale'.
*/
public string $id;
/**
* Name attribute of the select element.
*
* Default 'locale'.
*/
public string $name;
/**
* List of installed languages, contain only the locales.
*
* Default empty array.
*
* @var mixed[]
*/
public array $languages;
/**
* List of available translations.
*
* Default result of wp_get_available_translations().
*
* @var mixed[]
*/
public array $translations;
/**
* Language which should be selected.
*
* Default empty.
*/
public string $selected;
/**
* Whether to echo the generated markup.
*
* Default true.
*/
public bool $echo;
/**
* Whether to show available translations.
*
* Default true.
*/
public bool $show_available_translations;
/**
* Whether to show an option to fall back to the site's locale.
*
* Default false.
*/
public bool $show_option_site_default;
/**
* Whether to show an option for English (United States).
*
* Default true.
*/
public bool $show_option_en_us;
/**
* Whether the English (United States) option uses an explicit value of en_US instead of an empty value.
*
* Default true.
*/
public bool $explicit_option_en_us;
}

View File

@ -0,0 +1,133 @@
<?php
declare(strict_types=1);
namespace Args;
use WP_Term;
/**
* Arguments for the `$args` parameter of the `wp_generate_tag_cloud()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/wp_generate_tag_cloud/
*/
class wp_generate_tag_cloud extends Shared\Base {
/**
* Smallest font size used to display tags.
*
* Paired with the value of `$unit`, to determine CSS text size unit.
*
* Default 8 (pt).
*/
public int $smallest;
/**
* Largest font size used to display tags.
*
* Paired with the value of `$unit`, to determine CSS text size unit.
*
* Default 22 (pt).
*/
public int $largest;
/**
* CSS text size unit to use with the `$smallest` and `$largest` values.
*
* Accepts any valid CSS text size unit.
*
* Default 'pt'.
*/
public string $unit;
/**
* The number of tags to return.
*
* Accepts any positive integer or zero to return all.
*
* Default 0.
*
* @phpstan-var positive-int | 0
*/
public int $number;
/**
* Format to display the tag cloud in.
*
* Accepts 'flat' (tags separated with spaces), 'list' (tags displayed in an unordered list), or 'array' (returns an array).
*
* Default 'flat'.
*/
public string $format;
/**
* HTML or text to separate the tags.
*
* Default "\n" (newline).
*/
public string $separator;
/**
* Value to order tags by.
*
* Accepts 'name' or 'count'.
*
* The {@see 'tag_cloud_sort'} filter can also affect how tags are sorted.
*
* Default 'name'.
*/
public string $orderby;
/**
* How to order the tags.
*
* Accepts 'ASC' (ascending), 'DESC' (descending), or 'RAND' (random).
*
* Default 'ASC'.
*
* @phpstan-var 'ASC'|'DESC'|'RAND'
*/
public string $order;
/**
* Whether to enable filtering of the final output via {@see 'wp_generate_tag_cloud'}.
*
* Default true.
*/
public bool $filter;
/**
* Nooped plural text from _n_noop() to supply to tag counts.
*
* Default null.
*
* @var mixed[]
*/
public array $topic_count_text;
/**
* Callback used to generate nooped plural text for tag counts based on the count.
*
* Default null.
*
* @var callable
* @phpstan-var callable(int,WP_Term,mixed[]): int
*/
public $topic_count_text_callback;
/**
* Callback used to determine the tag count scaling value.
*
* Default default_topic_count_scale().
*
* @var callable
* @phpstan-var callable(int): int
*/
public $topic_count_scale_callback;
/**
* Whether to display the tag counts.
*
* Default false.
*/
public bool $show_count;
}

View File

@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Args;
/**
* Arguments for the `wp_get_nav_menus()` function in WordPress.
*
* @link https://developer.wordpress.org/reference/functions/wp_get_nav_menus/
* @link https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
*/
class wp_get_nav_menus extends WP_Term_Query {}

Some files were not shown because too many files have changed in this diff Show More