-
AuthorPosts
-
January 10, 2023 at 1:03 pm #1378122
hello
whe have a permission issue for the editor to put a player in iframe code in the commun wordpress editor.
i try with a another theme and it’s working, so i think is the enfold’s theme code who is doing that bug.when im using avia for a post and i add a iframe code it’s breaks the page (the sidebar is going under the principal content)
so i want to use the wordpress editor, and it’s working when im in admin role.
but my collaborator who is an editor, when Hello try to do the same, it’s working, he see the player on the admin page
but when he save, the code desapear from the admin page.
the code :
<iframe id=”ausha-Q1gk” style=”border: none; width: 100%; height: 420px;” src=”https://player.ausha.co/index.html?showId=xqq1rsdgmOnE&display=horizontal&color=%2372238e&playlist=true&podcastId=Lyg64YI84pno&v=3&playerId=ausha-Q1gk” height=”420″ frameborder=”0″></iframe><script src=”https://player.ausha.co/ausha-player.js”></script>January 11, 2023 at 6:59 am #1378200Hey mediafacto,
Thank you for the inquiry.
The builder doesn’t accept iframes or input tags by default. You may need to create a custom shortcode for the iframe so that you don’t have to add it directly to the layout builder.
// https://codex.wordpress.org/Shortcode_API
Best regards,
IsmaelJanuary 11, 2023 at 11:48 am #1378242ok
but when i using the wordpress’s text editor, why it’s working when im in admin mode and it doesn’t when im in editor mode .?i try on a another theme and it’s always working, so i think, the enfold theme hinder the editor role to do it
what do you think ?
January 11, 2023 at 11:59 am #1378243and i have a different iframe. code for each post and i can’t ask to my client to create a short code for every iframe he want.
January 12, 2023 at 8:17 am #1378350Hi,
The Advance Layout Builder (ALB) is different from the default editor and unfortunately, the ALB doesn’t accept iframe or input tags. You don’t need to create a custom shortcode for every iframe, just create a custom shortcode that accepts attributes so that you can render different videos using the same shortcode.
Example:
function avs_ausha_player_callback( $atts, $content = null ) { $a = shortcode_atts( array( 'pod' => 'Lyg64YI84pno', 'show' => 'xqq1rsdgmOnE', 'player' => 'ausha-Q1gk' ), $atts ); return '<iframe id="ausha-Q1gk" style="border: none; width: 100%; height: 420px;" src="https://player.ausha.co/index.html?showId=' . $a['show'] . '&display=horizontal&color=%2372238e&playlist=true&podcastId="' . $a['pod'] . '&v=3&playerId=' . $a['player'] . '" height="420″ frameborder="0″></iframe><script src="https://player.ausha.co/ausha-player.js"></script>'; } add_shortcode( 'avs_ausha', 'avs_ausha_player_callback' );
The shortcode for the player or iframe above would look like this.
[avs_ausha pod="Lyg64YI84pno" show="xqq1rsdgmOnE" player="ausha-Q1gk"]
The value of the attributes pod, show and player are based on the parameters podcastId, showId and playerId in the player’s URL.
https://player.ausha.co/index.html?showId=xqq1rsdgmOnE&display=horizontal&color=%2372238e&playlist=true&podcastId=Lyg64YI84pno&v=3&playerId=ausha-Q1g
You can place the shortcode in a text or code block.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.