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

Duplicate get_youtube_id() necessary? #664

Closed
blobaugh opened this issue Jun 5, 2014 · 1 comment
Closed

Duplicate get_youtube_id() necessary? #664

blobaugh opened this issue Jun 5, 2014 · 1 comment
Labels
[Feature] Shortcodes / Embeds [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Milestone

Comments

@blobaugh
Copy link
Contributor

blobaugh commented Jun 5, 2014

There are 2 instances of get_youtube_id() in Jetpack. Both functions are the same.

function get_youtube_id( $url ) {

function get_youtube_id( $url ) {

There is additionally a function jetpack_shortcode_get_youtube_id That contains the comment:
Same as get_youtube_id(), but with the prefix that function should've had.

So functionally 3 places to call the same thing.

Outside of the shortcode get_youtube_id() is used in two places:

$id = get_youtube_id( $video_url );

$id = get_youtube_id( $video_url );

It looks like @mdawaffe created the function in the shortcode and @justinshreve created the function in the functions.compat file.

We should not be running both of these. Because the function needs to be callable outside of the shortcode can we leave the function in the functions.compat file and remove it from the shortcode?

@blobaugh blobaugh added this to the 3.1 Freeze milestone Jun 5, 2014
@jeherve
Copy link
Member

jeherve commented Jun 6, 2014

Related: #126

blobaugh added a commit that referenced this issue Jun 10, 2014
This exact function is duplicated in the functions.compat file. Because other modules
need access to the function it is remaining in the functions.compat file.
Related #664
blobaugh added a commit that referenced this issue Jun 12, 2014
This exact function is duplicated in the functions.compat file. Because other modules
need access to the function it is remaining in the functions.compat file.
Related #664
blobaugh added a commit to jeherve/jetpack that referenced this issue Jun 13, 2014
This exact function is duplicated in the functions.compat file. Because other modules
need access to the function it is remaining in the functions.compat file.
Related Automattic#664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Shortcodes / Embeds [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

No branches or pull requests

2 participants