Skip to content

PHP Notice: Only variables should be passed by reference #656

@mikeyarce

Description

@mikeyarce

Expected/Desired Behavior

No PHP Notices.

Actual Behavior

PHP Notice:

[07-Jun-2021 18:36:16 UTC] PHP Notice:  Only variables should be passed by reference in wp-content/plugins/Edit-Flow/common/php/screen-options.php on line 169
component: "Plugin: Edit-Flow"
file: "wp-content/plugins/Edit-Flow/common/php/screen-options.php"
key: "b70f237b117c737f6e624ed611138805"
line: 169
message: "Only variables should be passed by reference"
stack: Array(2)
0: "wsScreenOptions10->ajax_save_callback()"
1: "do_action('wp_ajax_save_settings-ef_story_budget_screen_columns')"
length: 2
__proto__: Array(0)
type: "notice"
__proto__: Object

How does the plugin/feature/module currently work.

Steps to Reproduce the Problem

  1. Go to Dashboard > Story Budget
  2. From the top click Screen
  3. Change "Number of Columns" to something else

(Optional) Additional notes

The problem comes from: https://github.com/Automattic/Edit-Flow/blob/master/common/php/screen-options.php#L169

I think this:
$id = end(explode('-', $_POST['action'], 2));

Should be split into two lines:

$ids = explode('-', $_POST['action'], 2);
$id = end($ids);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions