Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit f6edf06

Browse files
committed
linting
1 parent a94e55b commit f6edf06

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

command.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,25 @@
2323
*/
2424
function codeat_get_by_url( $args ){
2525
$url = parse_url( esc_html( $args[0] ) );
26-
$slug = $url['path'];
27-
$last_slug = array_filter( explode('/', $slug), 'strlen' );
28-
$last_slug = $last_slug[count($last_slug)];
29-
$post = get_posts(array(
26+
$slug = $url[ 'path' ];
27+
$last_slug = array_filter( explode( '/', $slug ), 'strlen' );
28+
$last_slug = $last_slug[ count( $last_slug ) ];
29+
30+
$post = get_posts( array(
3031
'name' => $last_slug,
3132
'posts_per_page' => 1,
3233
));
3334
$post = $post[ 0 ];
3435
if ( is_object( $post ) ) {
35-
WP_CLI::log( $post->ID . ' | ' . $post->post_type );
36+
WP_CLI::log( 'post | ' . $post->ID . ' | ' . $post->post_type );
3637
return;
3738
}
3839

3940
$taxonomies = get_taxonomies();
4041
foreach ( $taxonomies as $tax_type_key => $taxonomy ) {
4142
$tax = get_term_by( 'slug', $last_slug, $taxonomy );
4243
if( is_object( $tax ) ) {
43-
WP_CLI::log( $tax->term_id . ' | ' . $tax->taxonomy );
44+
WP_CLI::log( 'term | ' . $tax->term_id . ' | ' . $tax->taxonomy );
4445
return;
4546
}
4647
}

0 commit comments

Comments
 (0)