Skip to content

API function/method: Get all WPSEO related capabilities#9365

Merged
Dieterrr merged 5 commits intoYoast:trunkfrom
JoryHogeveen:patch-2
Sep 6, 2018
Merged

API function/method: Get all WPSEO related capabilities#9365
Dieterrr merged 5 commits intoYoast:trunkfrom
JoryHogeveen:patch-2

Conversation

@JoryHogeveen
Copy link
Copy Markdown
Contributor

@JoryHogeveen JoryHogeveen commented Mar 27, 2018

Summary

This PR can be summarized in the following changelog entry:

  • Add API function to get all WPSEO related capabilities.
    Props to: JoryHogeveen

Relevant technical choices:

Used the capability manager class instance.

Test instructions

This PR can be tested by following these steps:

Call the function. It should return the following:
Array ( [0] => wpseo_bulk_edit [1] => wpseo_edit_advanced_metadata [2] => wpseo_manage_options )

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended

Fixes #9300

@JoryHogeveen
Copy link
Copy Markdown
Contributor Author

JoryHogeveen commented Apr 10, 2018

For reference:

@moorscode mentioned https://github.com/Yoast/wordpress-seo/blob/trunk/wp-seo-main.php#L170-L174 as a difference in code order.
The last commit made this more in line with wp-seo-main logic.

This function shouldn't call add() from the capability factory because that method adds the capabilities to the roles which is not the purpose of this function.

@JoryHogeveen JoryHogeveen mentioned this pull request Apr 11, 2018
18 tasks
@JoryHogeveen
Copy link
Copy Markdown
Contributor Author

Note: Since 7.3 is out the version tag for this function should be updated before merging.

JoryHogeveen added a commit to JoryHogeveen/view-admin-as that referenced this pull request May 2, 2018
@afercia
Copy link
Copy Markdown
Contributor

afercia commented Sep 6, 2018

CR 👍

Of course, the @since notation should be updated before merge.

updated @SInCE to 8.3 of wpseo_get_capabilities()
@Dieterrr
Copy link
Copy Markdown
Contributor

Dieterrr commented Sep 6, 2018

Acceptance done 👍
Updated @since to 8.3.

@Dieterrr Dieterrr merged commit ee304ee into Yoast:trunk Sep 6, 2018
@Dieterrr Dieterrr added this to the 8.3 milestone Sep 6, 2018
@JoryHogeveen JoryHogeveen deleted the patch-2 branch September 6, 2018 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants