mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 18:54:29 +00:00
Coding Standards: Extract extract() from the codebase.
Of the last four instances of `extract()` occurring, three of them are removed by this commit, and the fourth is appropriately documented. See #45934. git-svn-id: https://develop.svn.wordpress.org/trunk@44569 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -29,15 +29,14 @@ class Tests_Post_Output extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
function _shortcode_paragraph( $atts, $content ) {
|
||||
extract(
|
||||
shortcode_atts(
|
||||
array(
|
||||
'class' => 'graf',
|
||||
),
|
||||
$atts
|
||||
)
|
||||
$processed_atts = shortcode_atts(
|
||||
array(
|
||||
'class' => 'graf',
|
||||
),
|
||||
$atts
|
||||
);
|
||||
return "<p class='$class'>$content</p>\n";
|
||||
|
||||
return "<p class='{$processed_atts['class']}'>$content</p>\n";
|
||||
}
|
||||
|
||||
function test_the_content() {
|
||||
|
||||
@@ -43,18 +43,16 @@ class Tests_Shortcode extends WP_UnitTestCase {
|
||||
|
||||
// [bartag foo="bar"]
|
||||
function _shortcode_bartag( $atts ) {
|
||||
extract(
|
||||
shortcode_atts(
|
||||
array(
|
||||
'foo' => 'no foo',
|
||||
'baz' => 'default baz',
|
||||
),
|
||||
$atts,
|
||||
'bartag'
|
||||
)
|
||||
$processed_atts = shortcode_atts(
|
||||
array(
|
||||
'foo' => 'no foo',
|
||||
'baz' => 'default baz',
|
||||
),
|
||||
$atts,
|
||||
'bartag'
|
||||
);
|
||||
|
||||
return "foo = {$foo}";
|
||||
return "foo = {$processed_atts['foo']}";
|
||||
}
|
||||
|
||||
// [baztag]content[/baztag]
|
||||
|
||||
Reference in New Issue
Block a user