Skip to content

Instantly share code, notes, and snippets.

@annalinneajohansson
annalinneajohansson / plugin-settings.php
Last active October 2, 2024 09:42
A base for a WordPress plugin settings page, using the Settings API #add_options_page #add_action #admin_init #register_setting #add_settings_section
<?php
# http://kovshenin.com/2012/the-wordpress-settings-api/
# http://codex.wordpress.org/Settings_API
add_action( 'admin_menu', 'my_admin_menu' );
function my_admin_menu() {
add_options_page( __('My Plugin Options', 'textdomain' ), __('My Plugin Options', 'textdomain' ), 'manage_options', 'my-plugin', 'my_options_page' );
}
add_action( 'admin_init', 'my_admin_init' );
@rotty3000
rotty3000 / description.md
Last active February 2, 2018 00:14
pacl policy process
  1. place the plugin into generate mode:

     security-manager-enabled=generate
    
  2. with no other policy rules in place, the policy for the app will behave as if PACL is enabled (performing expected checks)

  3. however, rather than throwing an error on failed security checks, causing the plugin to fail, the individual checker which caused the failuer will contribute a suggested rule which resolves the failed check

  4. the rules will be collected and writen (on the fly) to a properties file

  5. the default write location is:

${liferay.home}/pacl-policy/${servletContextName}.policy