A plugin to help you to embed a GovRight AngularJS app into your site. Provides an easy app setup and automates some things like authentication callback and social sharing.
- Handling the
/auth/success
callback, making users able to login in the app right from your site - Proxying social robots requests to the original app so the embedded app is sharable on Facebook and others
- Providing a settings page for easy app setup
- Providing the
[corpus-app]
shortcode for easy app embedding
- Install and activate the plugin
- Go to "GovRight" > "Embedded App" in the admin
- Select an application
- Set up the law slug
- Insert the
[corpus-app]
shortcode where you want to see the app
There are two ways to insert the app into your site
- In a post/page text using the shortcode:
[corpus-app]
- In a template using the snippet:
<?php corpus_app(); ?>
data-locale
- locale code likeen
,ru
, etc, to set initial app localedata-app-port
- app port number like9000
, for local developmentdata-law-slug
- law slug, overrides the law slug set in plugin options in wp admin
These can also be passed to the corpus_app()
function as an array, like
<?php corpus_app(array(
'data-locale' => 'en',
'data-app-port' => 9000
)); ?>
wpce_social_urls_white_list
| Filter | Is used to make changes to the social interceptor white list. Example:
add_filter('wpce_social_urls_white_list', function() {
return array('/', '/en', '/fr', '/ar');
});
Most likely app urls in your local environment look like localhost:9000
. You can override app urls and
any other config items adding a snippet like this to you local wp-config.php
:
$GLOBALS['WPCE_LOCAL_CONFIG'] = array(
'rev-tracker' => array(
'auth_post_url' => 'http://localhost:9000/auth/success'
'loader_url' => 'http://localhost:9000/loader.js',
)
);
Items from $GLOBALS['WPCE_LOCAL_CONFIG']
override default plugin config, check includes/config.php
for better
insight of the plugin config structure.