Skip to content

Commit 2a96ff4

Browse files
authored
Merge pull request #185 from bcc-code/feature/add-newsfeed-shortcodes
Add newsfeed shortcodes
2 parents 31d1dd2 + f5a8be3 commit 2a96ff4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

plugins/bcc-login/includes/class-bcc-login-widgets.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,19 @@ function bcc_widgets_shortcodes() {
9090

9191
return $html . PHP_EOL;
9292
} );
93+
94+
add_shortcode( 'bcc-newsfeed-new', function () {
95+
$html = '<bcc-newsfeed-new authentication-type="WebApp" authentication-location="' . site_url( '?bcc-login=access-token' ) .'" ';
96+
$html .= 'language="' . get_culture() . '"></bcc-newsfeed-new>';
97+
98+
return $html . PHP_EOL;
99+
} );
100+
101+
add_shortcode( 'bcc-newsfeed-public', function () {
102+
$html = '<bcc-newsfeed-public language="' . get_culture() . '"></bcc-newsfeed-public>';
103+
$html .= '<script src="https://widgets.bcc.no/scripts/main.js" type="module"></script>';
104+
105+
return $html . PHP_EOL;
106+
} );
93107
}
94108
}

0 commit comments

Comments
 (0)