Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes most uses of extract() #1565

Merged
merged 23 commits into from
Nov 8, 2018
Merged

Removes most uses of extract() #1565

merged 23 commits into from
Nov 8, 2018

Conversation

benlk
Copy link
Collaborator

@benlk benlk commented Nov 8, 2018

Changes

Removes extract() calls from most places in Largo:

  • ./inc/users.php
  • ./homepages/homepage-class.php: extract($vars);
  • ./inc/editor.php: extract( shortcode_atts( array(
  • ./inc/helpers.php: * @return string the Facebook username or id extracted from the input string
  • ./inc/helpers.php: * @return string the twitter username extracted from the input string
  • ./inc/pagination.php: extract( $r, EXTR_SKIP );
  • ./inc/widgets/largo-about.php: extract( $args );
  • ./inc/widgets/largo-author-bio.php: extract( $args );
  • ./inc/widgets/largo-disclaimer-widget.php: extract( $args );
  • ./inc/widgets/largo-donate.php: extract( $args );
  • ./inc/widgets/largo-facebook.php: extract( $args );
  • ./inc/widgets/largo-follow.php: extract( $args );
  • ./inc/widgets/largo-image-widget.php: extract( $args );
  • ./inc/widgets/largo-image-widget.php: // Using extracted vars now
  • ./inc/widgets/largo-image-widget.php: extract( $instance );
  • ./inc/widgets/largo-post-series-links.php: extract( $args );
  • ./inc/widgets/largo-prev-next-post-links.php: extract( $args );
  • ./inc/widgets/largo-recent-comments.php: extract( $args );
  • ./inc/widgets/largo-recent-posts.php: extract( $args );
  • ./inc/widgets/largo-related-posts.php: extract( $args );
  • ./inc/widgets/largo-series-posts.php: extract( $args );
  • ./inc/widgets/largo-tag-list.php: extract( $args );
  • ./inc/widgets/largo-taxonomy-list.php: extract( $args );
  • ./inc/widgets/largo-twitter.php: extract( $args );
  • ./js/tinymce/plugins/largo/window.php: <li><input type="radio" name="mod_width" value="extract" id="extract"> Extract from Embed (non-responsive)</li>
  • ./lib/class-tgm-plugin-activation.php: * Helper function to extract the file path of the plugin file from the
  • ./lib/class-tgm-plugin-activation.php: * Constructor. Parses default args with new ones and extracts them for use.
  • ./lib/navis-media-credit/navis-media-credit.php: extract( $atts );

The remaining places:

./homepages/homepage-class.php:		extract($vars);
./partials/content.php:extract( $args );
./tests/inc/test-users.php:		extract($vars);
./tests/inc/test-users.php:		extract($vars);
./tests/inc/test-users.php:		extract($args);

Also:

  • Twitter Widget JS is no longer enqueued in largo_footer_js(); instead being enqueued directly from the widget.
  • Fixes some undefined index errors in widget form and update functions.
  • Whitespace cleanup in some places

Why

Because extract() is risky.

@benlk benlk added type: bug priority: high Either blocks work on a priority-normal task or a solution here informs other work. labels Nov 8, 2018
@benlk benlk merged commit 660afef into 0.5-dev Nov 8, 2018
@benlk benlk deleted the 1-extract branch November 10, 2018 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high Either blocks work on a priority-normal task or a solution here informs other work. type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant