array( 'post', 'page' ), 'widget_position' => 'right', 'widget_enabled' => true, 'actions' => ajwa_default_actions(), ) ); } } /** * Default widget actions. * * @return array */ function ajwa_default_actions() { return array( array( 'id' => 'copy_md', 'enabled' => true, 'label' => 'Copy this page as Markdown for LLMs', 'icon' => 'copy', 'type' => 'copy_markdown', 'link' => '', 'order' => 1, ), array( 'id' => 'view_md', 'enabled' => true, 'label' => 'View this page as plain text', 'icon' => 'plain-text', 'type' => 'view_markdown', 'link' => '', 'order' => 2, ), array( 'id' => 'chatgpt', 'enabled' => true, 'label' => 'Ask questions about this page in ChatGPT', 'icon' => 'gpt', 'type' => 'external_link', 'link' => 'https://chatgpt.com/?q=Read [md_url] so I can ask questions about it', 'order' => 3, ), array( 'id' => 'claude', 'enabled' => true, 'label' => 'Ask questions about this page in Claude', 'icon' => 'claude', 'type' => 'external_link', 'link' => 'https://claude.ai/new?q=Read [md_url] so I can ask questions about it', 'order' => 4, ), ); } /** * Get plugin settings with defaults merged. * * @return array */ function ajwa_get_settings() { $settings = get_option( 'ajwa_settings', array() ); $defaults = array( 'enabled_post_types' => array( 'post', 'page' ), 'widget_position' => 'right', 'widget_enabled' => true, 'actions' => ajwa_default_actions(), ); return wp_parse_args( $settings, $defaults ); } // Bootstrap all classes. AJWA_Settings::init(); AJWA_Meta_Box::init(); AJWA_Endpoint::init(); AJWA_Frontend::init(); AJWA_Shortcode::init(); /** * Register the sidebar widget. */ function ajwa_register_widget() { register_widget( 'AJWA_Widget' ); } add_action( 'widgets_init', 'ajwa_register_widget' );