'' . __( 'Generate Shortcode', 'abl_amamc_td' ) . '' ), $links ); } add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'amamc_settings_link' ); // Add Donate Link to Plugins list function amamc_plugin_row_meta( $links, $file ) { if ( strpos( $file, 'amamc_ask-me-anything.php' ) !== false ) { $new_links = array( 'donate' => 'Donate', 'hireme' => 'Hire Me For A Project', ); $links = array_merge( $links, $new_links ); } return $links; } add_filter( 'plugin_row_meta', 'amamc_plugin_row_meta', 10, 2 ); // Load Text Domain function amamc_load_plugin_textdomain() { load_plugin_textdomain( 'abl_amamc_td', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' ); } add_action( 'plugins_loaded', 'amamc_load_plugin_textdomain' ); // Register Settings function amamc_register_settings() { register_setting( 'amamc_settings_group', 'amamc_custom_css', 'amamc_clean_css_with_csstidy' ); } add_action( 'admin_init', 'amamc_register_settings' ); // Delete Options During Uninstall function amamc_uninstall_plugin() { delete_option( 'amamc_custom_css' ); } register_uninstall_hook(__FILE__, 'amamc_uninstall_plugin' ); /*--------------------------------------*/ /* Admin Options Page */ /*--------------------------------------*/ // Load Syntax Highlighter function amamc_register_highlighter( $hook ) { if ( 'settings_page_ask-me-anything-shortcode-generator' === $hook ) { wp_enqueue_style( 'highlighter-css', plugins_url( basename( dirname( __FILE__ ) ) . '/inc/highlighter/codemirror.css' ) ); wp_enqueue_script( 'highlighter-js', plugins_url( basename( dirname( __FILE__ ) ) . '/inc/highlighter/codemirror.js' ), array(), '20140329', true ); wp_enqueue_script( 'highlighter-css-js', plugins_url( basename( dirname( __FILE__ ) ) . '/inc/highlighter/css.js' ), array(), '20140329', true ); } } add_action( 'admin_enqueue_scripts', 'amamc_register_highlighter' ); // Sanitize CSS with CSS Tidy - Uses CSS Tidy Modified By The Jetpack Team. function amamc_clean_css_with_csstidy ( $input ) { $input['amamc_admin_css'] = amamc_csstidy_helper ( $input['amamc_admin_css'] ); return $input; } // Scrub And Clean With CSS Tidy function amamc_csstidy_helper ( $css, $minify=false ) { include_once('inc/csstidy/class.csstidy.php'); $csstidy = new csstidy(); $csstidy->set_cfg( 'remove_bslash', false ); $csstidy->set_cfg( 'compress_colors', false ); $csstidy->set_cfg( 'compress_font-weight', false ); $csstidy->set_cfg( 'optimise_shorthands', 0 ); $csstidy->set_cfg( 'remove_last_;', false ); $csstidy->set_cfg( 'case_properties', false ); $csstidy->set_cfg( 'discard_invalid_properties', true ); $csstidy->set_cfg( 'css_level', 'CSS3.0' ); $csstidy->set_cfg( 'preserve_css', true ); if ($minify === false) { $csstidy->set_cfg( 'template', dirname( __FILE__ ) . '/inc/csstidy/wordpress-standard.tpl' ); } else { $csstidy->set_cfg( 'template', 'highest'); } $css = preg_replace( '/\\\\([0-9a-fA-F]{4})/', '\\\\\\\\$1', $css ); $css = str_replace( '<=', '<=', $css ); $css = wp_kses_split( $css, array(), array() ); $css = str_replace( '>', '>', $css ); // kses replaces lone '>' with > $css = strip_tags( $css ); $csstidy->parse( $css ); $css = $csstidy->print->plain(); return $css; } // Admin Interface Renderer function amamc_admin_interface_render () { ?>

my website at the bottom of the page.','abl_amamc_td'),'http://millionclues.com/'); ?>

>
0, 'latest_first' => true, 'anonymous_name' => __('Someone','abl_amamc_td'), 'success_text' => __('Your question is saved and will appear when it is answered.','abl_amamc_td'), 'question_box_title'=> __('Your Question','abl_amamc_td'), 'placeholder' => __('In the spirit of keeping it anonymous, please do not leave any personal information.','abl_amamc_td'), 'test_question' => __('What is 7+5?','abl_amamc_td'), 'test_answer' => __('12','abl_amamc_td'), 'ask_button_text' => __('Ask Anonymously','abl_amamc_td'), 'answer_list_title' => __('Answers So Far..','abl_amamc_td'), 'no_answers_text' => __('Be the first to ask!','abl_amamc_td'), 'questions_per_page'=> 10, 'avatar' => 'monsterid', // 'retro' (8bit), 'monsterid' (monster), 'wavatar' (cartoon face), 'indenticon', 'mysteryman', 'blank', 'gravatar_default' 'avatar_size' => 96, // max is 512 'show_question_box' => true, 'show_answers' => true, 'show_navigation' => true, 'show_test_question'=> true, 'show_do_action' => false, 'give_thanks' => false, ), $atts ) ); // Code ob_start(); // This function returns everything from here until ob_get_clean() ?>
Please refer Installation instructions.','abl_amamc_td'); } else if ( $post_or_page_id != 0 || in_the_loop() ) { if ( $post_or_page_id == 0 ) { $post_or_page_id = get_the_ID(); // Assign current page or post id if post_or_page_id attribute is not set. } // Load The CSS To Style The AMA Form wp_enqueue_style('amamc_ask-me-anything', plugin_dir_url( __FILE__ ) . 'css/amamc_ask-me-anything.css'); amamc_load_custom_css(); // Disable Default Comments By Loading A Blank Comments Template As Defined In amamc_disable_default_comments() When AMA Form Is Used On A Page Or Post (in_the_loop()) if ( in_the_loop() ) { add_filter( "comments_template", "amamc_disable_default_comments" ); } ?>

    $post_or_page_id, 'status' => 'approve', 'order' => $order, 'parent' => 0, // Questions are parent comments. 'number' => $questions_per_page, 'offset' => $offset, )); $class = 'alternate'; foreach ($questions as $question) { $class = ('alternate' == $class) ? '' : 'alternate'; ?>
  • comment_author_email, $avatar_size, $avatar ); ?>
    comment_content; ?>
    $post_or_page_id, 'status' => 'approve', 'order' => 'DESC', 'parent' => $question->comment_ID, )); ?>
    • comment_author_email, $avatar_size ); ?> comment_author; ?>
      comment_content; ?>
get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID=$post_or_page_id AND comment_approved=1 AND comment_parent=0"); if ( $number_of_questions > $questions_per_page ) { echo ''; } } ?>

AMA by Million Clues!'; } ?>
', $amamc_admin_css_content ); // Minify if ( (isset($amamc_custom_css_option['minfy_css'])) && (boolval($amamc_custom_css_option['minfy_css'])) ) { $amamc_admin_css_content = amamc_csstidy_helper($amamc_admin_css_content, true); } ?>