@@ -1680,7 +1680,7 @@ protected function _insert_post( $user, $content_struct ) {
16801680 }
16811681
16821682 // Handle enclosures.
1683- $ enclosure = isset ( $ post_data ['enclosure ' ] ) ? $ post_data [ ' enclosure ' ] : null ;
1683+ $ enclosure = $ post_data ['enclosure ' ] ?? null ;
16841684 $ this ->add_enclosure_if_new ( $ post_id , $ enclosure );
16851685
16861686 $ this ->attach_uploads ( $ post_id , $ post_data ['post_content ' ] );
@@ -1986,7 +1986,7 @@ public function wp_getPosts( $args ) {
19861986
19871987 $ username = $ args [1 ];
19881988 $ password = $ args [2 ];
1989- $ filter = isset ( $ args [3 ] ) ? $ args [ 3 ] : array ();
1989+ $ filter = $ args [3 ] ?? array ();
19901990
19911991 if ( isset ( $ args [4 ] ) ) {
19921992 $ fields = $ args [4 ];
@@ -2457,7 +2457,7 @@ public function wp_getTerms( $args ) {
24572457 $ username = $ args [1 ];
24582458 $ password = $ args [2 ];
24592459 $ taxonomy = $ args [3 ];
2460- $ filter = isset ( $ args [4 ] ) ? $ args [ 4 ] : array ();
2460+ $ filter = $ args [4 ] ?? array ();
24612461
24622462 $ user = $ this ->login ( $ username , $ password );
24632463 if ( ! $ user ) {
@@ -2615,7 +2615,7 @@ public function wp_getTaxonomies( $args ) {
26152615
26162616 $ username = $ args [1 ];
26172617 $ password = $ args [2 ];
2618- $ filter = isset ( $ args [3 ] ) ? $ args [ 3 ] : array ( 'public ' => true );
2618+ $ filter = $ args [3 ] ?? array ( 'public ' => true );
26192619
26202620 if ( isset ( $ args [4 ] ) ) {
26212621 $ fields = $ args [4 ];
@@ -2764,7 +2764,7 @@ public function wp_getUsers( $args ) {
27642764
27652765 $ username = $ args [1 ];
27662766 $ password = $ args [2 ];
2767- $ filter = isset ( $ args [3 ] ) ? $ args [ 3 ] : array ();
2767+ $ filter = $ args [3 ] ?? array ();
27682768
27692769 if ( isset ( $ args [4 ] ) ) {
27702770 $ fields = $ args [4 ];
@@ -3658,7 +3658,7 @@ public function wp_getComments( $args ) {
36583658
36593659 $ username = $ args [1 ];
36603660 $ password = $ args [2 ];
3661- $ struct = isset ( $ args [3 ] ) ? $ args [ 3 ] : array ();
3661+ $ struct = $ args [3 ] ?? array ();
36623662
36633663 $ user = $ this ->login ( $ username , $ password );
36643664 if ( ! $ user ) {
@@ -4433,7 +4433,7 @@ public function wp_getMediaLibrary( $args ) {
44334433
44344434 $ username = $ args [1 ];
44354435 $ password = $ args [2 ];
4436- $ struct = isset ( $ args [3 ] ) ? $ args [ 3 ] : array ();
4436+ $ struct = $ args [3 ] ?? array ();
44374437
44384438 $ user = $ this ->login ( $ username , $ password );
44394439 if ( ! $ user ) {
@@ -4624,7 +4624,7 @@ public function wp_getPostTypes( $args ) {
46244624
46254625 $ username = $ args [1 ];
46264626 $ password = $ args [2 ];
4627- $ filter = isset ( $ args [3 ] ) ? $ args [ 3 ] : array ( 'public ' => true );
4627+ $ filter = $ args [3 ] ?? array ( 'public ' => true );
46284628
46294629 if ( isset ( $ args [4 ] ) ) {
46304630 $ fields = $ args [4 ];
@@ -5375,7 +5375,7 @@ public function mw_newPost( $args ) {
53755375 $ username = $ args [1 ];
53765376 $ password = $ args [2 ];
53775377 $ content_struct = $ args [3 ];
5378- $ publish = isset ( $ args [4 ] ) ? $ args [ 4 ] : 0 ;
5378+ $ publish = $ args [4 ] ?? 0 ;
53795379
53805380 $ user = $ this ->login ( $ username , $ password );
53815381 if ( ! $ user ) {
@@ -5491,8 +5491,8 @@ public function mw_newPost( $args ) {
54915491 $ post_author = $ content_struct ['wp_author_id ' ];
54925492 }
54935493
5494- $ post_title = isset ( $ content_struct ['title ' ] ) ? $ content_struct [ ' title ' ] : '' ;
5495- $ post_content = isset ( $ content_struct ['description ' ] ) ? $ content_struct [ ' description ' ] : '' ;
5494+ $ post_title = $ content_struct ['title ' ] ?? '' ;
5495+ $ post_content = $ content_struct ['description ' ] ?? '' ;
54965496
54975497 $ post_status = $ publish ? 'publish ' : 'draft ' ;
54985498
@@ -5510,10 +5510,10 @@ public function mw_newPost( $args ) {
55105510 }
55115511 }
55125512
5513- $ post_excerpt = isset ( $ content_struct ['mt_excerpt ' ] ) ? $ content_struct [ ' mt_excerpt ' ] : '' ;
5514- $ post_more = isset ( $ content_struct ['mt_text_more ' ] ) ? $ content_struct [ ' mt_text_more ' ] : '' ;
5513+ $ post_excerpt = $ content_struct ['mt_excerpt ' ] ?? '' ;
5514+ $ post_more = $ content_struct ['mt_text_more ' ] ?? '' ;
55155515
5516- $ tags_input = isset ( $ content_struct ['mt_keywords ' ] ) ? $ content_struct [ ' mt_keywords ' ] : array ();
5516+ $ tags_input = $ content_struct ['mt_keywords ' ] ?? array ();
55175517
55185518 if ( isset ( $ content_struct ['mt_allow_comments ' ] ) ) {
55195519 if ( ! is_numeric ( $ content_struct ['mt_allow_comments ' ] ) ) {
@@ -5661,7 +5661,7 @@ public function mw_newPost( $args ) {
56615661 }
56625662
56635663 // Handle enclosures.
5664- $ enclosure = isset ( $ content_struct ['enclosure ' ] ) ? $ content_struct [ ' enclosure ' ] : null ;
5664+ $ enclosure = $ content_struct ['enclosure ' ] ?? null ;
56655665 $ this ->add_enclosure_if_new ( $ post_id , $ enclosure );
56665666
56675667 $ this ->attach_uploads ( $ post_id , $ post_content );
@@ -5771,7 +5771,7 @@ public function mw_editPost( $args ) {
57715771 $ username = $ args [1 ];
57725772 $ password = $ args [2 ];
57735773 $ content_struct = $ args [3 ];
5774- $ publish = isset ( $ args [4 ] ) ? $ args [ 4 ] : 0 ;
5774+ $ publish = $ args [4 ] ?? 0 ;
57755775
57765776 $ user = $ this ->login ( $ username , $ password );
57775777 if ( ! $ user ) {
@@ -5955,7 +5955,7 @@ public function mw_editPost( $args ) {
59555955 $ post_excerpt = $ content_struct ['mt_excerpt ' ];
59565956 }
59575957
5958- $ post_more = isset ( $ content_struct ['mt_text_more ' ] ) ? $ content_struct [ ' mt_text_more ' ] : '' ;
5958+ $ post_more = $ content_struct ['mt_text_more ' ] ?? '' ;
59595959
59605960 $ post_status = $ publish ? 'publish ' : 'draft ' ;
59615961 if ( isset ( $ content_struct [ "{$ post_type }_status " ] ) ) {
@@ -5972,7 +5972,7 @@ public function mw_editPost( $args ) {
59725972 }
59735973 }
59745974
5975- $ tags_input = isset ( $ content_struct ['mt_keywords ' ] ) ? $ content_struct [ ' mt_keywords ' ] : array ();
5975+ $ tags_input = $ content_struct ['mt_keywords ' ] ?? array ();
59765976
59775977 if ( 'publish ' === $ post_status || 'private ' === $ post_status ) {
59785978 if ( 'page ' === $ post_type && ! current_user_can ( 'publish_pages ' ) ) {
@@ -6080,7 +6080,7 @@ public function mw_editPost( $args ) {
60806080 }
60816081
60826082 // Handle enclosures.
6083- $ enclosure = isset ( $ content_struct ['enclosure ' ] ) ? $ content_struct [ ' enclosure ' ] : null ;
6083+ $ enclosure = $ content_struct ['enclosure ' ] ?? null ;
60846084 $ this ->add_enclosure_if_new ( $ post_id , $ enclosure );
60856085
60866086 $ this ->attach_uploads ( $ post_id , $ post_content );
@@ -7059,7 +7059,7 @@ public function pingback_ping( $args ) {
70597059 $ remote_source = preg_replace ( '/<\/*(h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/ ' , "\n\n" , $ remote_source );
70607060
70617061 preg_match ( '|<title>([^<]*?)</title>|is ' , $ remote_source , $ matchtitle );
7062- $ title = isset ( $ matchtitle [1 ] ) ? $ matchtitle [ 1 ] : '' ;
7062+ $ title = $ matchtitle [1 ] ?? '' ;
70637063 if ( empty ( $ title ) ) {
70647064 return $ this ->pingback_error ( 32 , __ ( 'A title on that page cannot be found. ' ) );
70657065 }
0 commit comments