Skip to content

Commit

Permalink
added notice for access token
Browse files Browse the repository at this point in the history
  • Loading branch information
akashmdiu committed May 21, 2024
1 parent d619502 commit 64ea971
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
17 changes: 17 additions & 0 deletions EmbedPress/Elementor/Widgets/Embedpress_Elementor.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,23 @@ protected function register_controls()
]
);

$this->add_control(
'instafeed_access_token_notice',
[
'type' => \Elementor\Controls_Manager::RAW_HTML,
'raw' => sprintf('%s <a href="%s" target="_blank">here</a>.',
esc_html__('To enable full Instagram embedding experience, please add your access token ', 'embedpress'),
esc_url(admin_url('/admin.php?page=embedpress&page_type=instagram'))
),
'content_classes' => 'elementor-panel-alert elementor-panel-warning-info',
'condition' => [
'embedpress_pro_embeded_source' => 'instafeed',
],
]
);



do_action('embedpress/embeded/extend', $this);
$this->add_control(
'embedpress_pro_embeded_source',
Expand Down
2 changes: 1 addition & 1 deletion EmbedPress/Providers/InstagramFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ public function getStaticResponse()
} else {
// No matching username found
$page = site_url() . "/wp-admin/admin.php?page=embedpress&page_type=instagram";
$insta_feed['html'] = '<p style="text-align:center;">Please add your access token from instagram settings page.</p>';
$insta_feed['html'] = '<p style="text-align:center;height:100%;display:flex;justify-content:center;align-items:center;margin:0;flex-direction: column;">To enable full Instagram embedding experience, please add your access token by navigating to: <b>Dashboard > EmbedPress > Settings > Sources > Instagram</></p>';
return $insta_feed;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Gutenberg/dist/blocks.build.js

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion Gutenberg/src/embedpress/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,17 @@ export default function Inspector({ attributes, setAttributes, isYTChannel, isYT
<div className='embedpress-gutenberg-controls'>
<PanelBody title={<div className='ep-pannel-icon'>{EPIcon} {__('General', 'embedpress')}</div>}>



<div className='ep-controls-margin'>
{
isInstagramFeed(url) && (
<PanelRow>
<div style={{ marginBottom: '10px', backgroundColor: '#ebe4ff', padding: '8px', borderRadius: '8px', fontWeight: 500 }} className='elementor-panel-alert elementor-panel-warning-info'>To enable full Instagram embedding experience, please add your access token <a href="/wp-admin/admin.php?page=embedpress&page_type=instagram" target='_blank'>here</a>.</div>
</PanelRow>

)
}

{
isYTLive && (
Expand Down Expand Up @@ -158,7 +168,7 @@ export default function Inspector({ attributes, setAttributes, isYTChannel, isYT
/>

{
((!isInstagramFeed(url) && !isInstagramHashtag(url)) && ((!isYTVideo && !isVimeoVideo && !isYTLive && !isSelfHostedVideo) || (videosize == 'fixed'))) && (
((!isInstagramFeed(url) && !isInstagramHashtag(url)) && ((!isYTVideo && !isVimeoVideo && !isYTLive && !isSelfHostedVideo) || (videosize == 'fixed'))) && (
<TextControl
label={__("Height")}
value={height}
Expand Down Expand Up @@ -197,6 +207,7 @@ export default function Inspector({ attributes, setAttributes, isYTChannel, isYT
{
isInstagramFeed(url) && (
<div>

<SelectControl
label="Feed Type"
value={instafeedFeedType}
Expand Down

0 comments on commit 64ea971

Please sign in to comment.