Skip to content

Commit 1980912

Browse files
committed
fix: default url + onboarding
1 parent e20bf71 commit 1980912

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

includes/admin/feedzy-rss-feeds-admin.php

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,24 +1835,8 @@ public function feedzy_block_editor_content( $wizard_data = array() ) {
18351835
return $post_content;
18361836
}
18371837

1838-
$feed_url = $wizard_data['feed'];
1839-
$feedzy_rest_url = get_rest_url( null, 'feedzy/v' . FEEDZY_REST_VERSION . '/feed/' );
1840-
$response = wp_remote_post(
1841-
$feedzy_rest_url,
1842-
array(
1843-
'timeout' => 100,
1844-
'body' => array(
1845-
'url' => array( $feed_url ),
1846-
),
1847-
)
1848-
);
1849-
if ( ! is_wp_error( $response ) ) {
1850-
$data = wp_remote_retrieve_body( $response );
1851-
$data = json_decode( $data );
1852-
$data->feeds = $feed_url;
1853-
$data = wp_json_encode( $data );
1854-
$post_content = '<!-- wp:feedzy-rss-feeds/feedzy-block ' . $data . ' /-->';
1855-
}
1838+
$feed_url = $wizard_data['feed'];
1839+
$post_content = '<!-- wp:feedzy-rss-feeds/loop {"feed":{"type":"url","source":["' . esc_url( $feed_url ) . '"]}} --><!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|30","right":"var:preset|spacing|30"},"margin":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30"}}},"layout":{"type":"constrained"}} --><div class="wp-block-group" style="margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--30);padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)"><!-- wp:image --><figure class="wp-block-image"><a href="{{feedzy_url}}"><img src="' . esc_url( FEEDZY_ABSURL . 'img/feedzy.svg' ) . '" alt="{{feedzy_title}}"/></a></figure><!-- /wp:image --><!-- wp:paragraph --><p><a href="{{feedzy_url}}">{{feedzy_title}}</a></p><!-- /wp:paragraph --><!-- wp:paragraph {"fontSize":"medium"} --><p class="has-medium-font-size">{{feedzy_meta}}</p><!-- /wp:paragraph --><!-- wp:paragraph {"fontSize":"small"} --><p class="has-small-font-size">{{feedzy_description}}</p><!-- /wp:paragraph --></div><!-- /wp:group --><!-- /wp:feedzy-rss-feeds/loop -->';
18561840
return $post_content;
18571841
}
18581842

js/FeedzyLoop/edit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ const Edit = ({ attributes, setAttributes, clientId }) => {
281281
'core/paragraph',
282282
{
283283
content:
284-
'<a href="http://{{feedzy_url}}">{{feedzy_title}}</a>',
284+
'<a href="{{feedzy_url}}">{{feedzy_title}}</a>',
285285
},
286286
],
287287
[

0 commit comments

Comments
 (0)