Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
}

if ( is_admin() ) {
/** @phpstan-ignore-next-line */ // phpcs:ignore
include_once ABSPATH . 'wp-admin/includes/plugin.php';

// Network activations first since is_plugin_active will return true for network activated plugins, whereas this won't for single.
Expand Down
28 changes: 0 additions & 28 deletions bin/baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -90,41 +90,13 @@ parameters:
count: 1
path: ../includes/admin/views/upgrade/notice.php

-
message: '#^Path in include_once\(\) "\./wp\-admin/includes/plugin\.php" is not a file or it does not exist\.$#'
identifier: includeOnce.fileNotFound
count: 1
path: ../includes/api/api-helpers.php

-
message: '#^Path in require_once\(\) "\.//wp\-admin/includes/file\.php" is not a file or it does not exist\.$#'
identifier: requireOnce.fileNotFound
count: 1
path: ../includes/api/api-helpers.php

-
message: '#^Path in require_once\(\) "\.//wp\-admin/includes/image\.php" is not a file or it does not exist\.$#'
identifier: requireOnce.fileNotFound
count: 1
path: ../includes/api/api-helpers.php

-
message: '#^Path in require_once\(\) "\.//wp\-admin/includes/media\.php" is not a file or it does not exist\.$#'
identifier: requireOnce.fileNotFound
count: 1
path: ../includes/api/api-helpers.php

-
message: '#^Offset ''thumb'' on array\{alt\: string, author\: string, authorName\: string, caption\: string, compat\: array, context\: string, date\: int, dateFormatted\: string, \.\.\.\}\|null in isset\(\) does not exist\.$#'
identifier: isset.offset
count: 1
path: ../includes/fields/class-acf-field-gallery.php

-
message: '#^Path in require\(\) "\./wp\-admin/includes/media\.php" is not a file or it does not exist\.$#'
identifier: require.fileNotFound
count: 1
path: ../includes/fields/class-acf-field-wysiwyg.php

-
message: '#^Undefined variable\: \$method$#'
Expand Down
8 changes: 4 additions & 4 deletions includes/api/api-helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2879,9 +2879,9 @@ function acf_get_valid_terms( $terms = false, $taxonomy = 'category' ) {
*
* @since ACF 5.2.3
*
* @param $attachment (array) attachment data. Changes based on context
* @param $field (array) field settings containing restrictions
* @param context (string) $file is different when uploading / preparing
* @param array $attachment attachment data. Changes based on context.
* @param array $field field settings containing restrictions.
* @param string $context context is different when uploading / preparing.
* @return $errors (array)
*/
function acf_validate_attachment( $attachment, $field, $context = 'prepare' ) {
Expand Down Expand Up @@ -3277,7 +3277,7 @@ function acf_is_ajax( $action = '' ) {
$is_ajax = false;

// check if is doing ajax
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
if ( wp_doing_ajax() ) {
$is_ajax = true;
}

Expand Down
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ includes:
- bin/baseline.neon
parameters:
level: 1
reportUnmatchedIgnoredErrors: false
ignoreErrors:
- '#^Path in (include_once|require_once|require)\(\) ".*wp-admin/includes/.*" is not a file#'
paths:
- .
excludePaths:
Expand All @@ -13,5 +16,6 @@ parameters:
- wordpress (?)
- includes/forms/WC_Order.php
bootstrapFiles:
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
- vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php
- bin/phpstan-bootstrap.php
1 change: 0 additions & 1 deletion secure-custom-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,6 @@ function scf_deactivate_other_instances() {
} elseif ( is_plugin_active( 'advanced-custom-fields/acf.php' ) ) {
// Check if the plugin to deactivate is 'advanced-custom-fields/acf.php' but the title is 'Secure Custom Fields'.
if ( ! function_exists( 'get_plugin_data' ) ) {
/** @phpstan-ignore-next-line */ // phpcs:ignore
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_to_deactivate );
Expand Down
Loading