Skip to content

Commit

Permalink
Merge pull request #185 from bcc-code/feature/add-newsfeed-shortcodes
Browse files Browse the repository at this point in the history
Add newsfeed shortcodes
  • Loading branch information
cs1m0n authored Jan 29, 2025
2 parents 31d1dd2 + f5a8be3 commit 2a96ff4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions plugins/bcc-login/includes/class-bcc-login-widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,19 @@ function bcc_widgets_shortcodes() {

return $html . PHP_EOL;
} );

add_shortcode( 'bcc-newsfeed-new', function () {
$html = '<bcc-newsfeed-new authentication-type="WebApp" authentication-location="' . site_url( '?bcc-login=access-token' ) .'" ';
$html .= 'language="' . get_culture() . '"></bcc-newsfeed-new>';

return $html . PHP_EOL;
} );

add_shortcode( 'bcc-newsfeed-public', function () {
$html = '<bcc-newsfeed-public language="' . get_culture() . '"></bcc-newsfeed-public>';
$html .= '<script src="https://widgets.bcc.no/scripts/main.js" type="module"></script>';

return $html . PHP_EOL;
} );
}
}

0 comments on commit 2a96ff4

Please sign in to comment.