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

Create a shortcode for WP_MARKET_SHARE #10

Closed
ryelle opened this issue Jul 20, 2022 · 5 comments · Fixed by #27
Closed

Create a shortcode for WP_MARKET_SHARE #10

ryelle opened this issue Jul 20, 2022 · 5 comments · Fixed by #27
Assignees
Labels
[Component] Backend Anything wp-admin or PHP-related

Comments

@ryelle
Copy link
Contributor

ryelle commented Jul 20, 2022

This is a single defined constant that provides the current WP market share (ex, 43%). In wporg-main, this is used to build strings, so that they don't need to be re-translated every time the percentage changes. It also keeps the value defined in one place, so we don't end up with 40% in one place, and 43% in another.

printf(
	/* translators: WordPress market share: 39 - Note: The following percent sign is '%%' for escaping purposes; */
	esc_html__( 'Use the software that powers over %s%% of the web.', 'wporg' ),
	esc_html( number_format_i18n( WP_MARKET_SHARE ) )
);

How should we handle this for content entered in the block editor?

@ryelle ryelle added the [Type] Question Needs input from others before actionable label Jul 20, 2022
@ryelle ryelle moved this to 🛑 On hold in WordPress.org Jul 20, 2022
@ryelle
Copy link
Contributor Author

ryelle commented Jul 20, 2022

There are also a few other places in the current front-page.php where we use dynamic counts.

These probably aren't as important - the copy might change, and even if not, these can probably stay static for a while. The meetup count was last updated 3 years ago, the only time since it was added.

@tellyworth
Copy link
Contributor

Could we do this with a few super-simple server side blocks? That basically just run your code snippet, or similar to it.

@dd32
Copy link
Member

dd32 commented Jul 22, 2022

IMHO; for the initial release I would just use an inline shortcode.

It looks like "tokens" will be shortcodes-v2 which would likely be the proper solution in future. WordPress/gutenberg#42015

@ryelle
Copy link
Contributor Author

ryelle commented Jul 22, 2022

IMHO; for the initial release I would just use an inline shortcode.

I agree. If we want to make it easier for editors we could add a toolbar button/dropdown like #16 to insert these, but spending too much time here doesn't make much sense if a core solution is on the way.

@ryelle ryelle changed the title How should we handle WP_MARKET_SHARE? Create a shortcode for WP_MARKET_SHARE Jul 25, 2022
@ryelle ryelle added [Component] Backend Anything wp-admin or PHP-related and removed [Type] Question Needs input from others before actionable labels Jul 25, 2022
@ryelle ryelle moved this from 🛑 Pending discussion to 📋 Backlog in WordPress.org Jul 25, 2022
@ryelle
Copy link
Contributor Author

ryelle commented Jul 25, 2022

Renamed & moved this to "to do" since it sounds like we have a path forward.

@ryelle ryelle moved this from 📋 To do to 🏗 In progress in WordPress.org Jul 28, 2022
@dd32 dd32 closed this as completed in #27 Jul 29, 2022
dd32 added a commit that referenced this issue Jul 29, 2022
@ryelle ryelle moved this from 🏗 In progress to ✅ Done in WordPress.org Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Backend Anything wp-admin or PHP-related
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants