Version: 2.1.1
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
#!/bin/sh | |
MESSAGE="$1" | |
VERSION_PATH=`git rev-parse --show-toplevel`"/style.css" | |
VER_TOKEN="Version:" | |
VER_STR=$(grep "$VER_TOKEN" $VERSION_PATH | awk '{print $2}' | tr -d '"') | |
VER_MAJ=$(echo $VER_STR | awk -F. '{print $1}') | |
VER_MIN=$(echo $VER_STR | awk -F. '{print $2}') |
<?php | |
/** | |
* Add custom fields to AnsPress question form. | |
* | |
* This hook will add two new fields in ask form. | |
* | |
* @param array $form Form arguments. | |
* @return void | |
*/ | |
function my_custom_question_field( $form ) { |
<?php | |
/** | |
* This hook will make question title to be more than 100 characters. | |
* | |
* @param array $form Form arguments. | |
* @return array | |
*/ | |
function my_ap_make_question_description_optional( $form ) { | |
$validate = $form['fields']['post_title']['validate']; | |
<?php | |
/** | |
* Override AnsPress form category field selection list. | |
* | |
* @param mixed $form | |
* @return mixed | |
*/ | |
function anspress_override_category_field( $form ){ | |
$form['fields']['category'] = array( | |
'label' => __( 'Category', 'anspress-question-answer' ), |
<?php | |
/** | |
* Add thumbnail support in question. | |
* @parm array Question cpt args. | |
**/ | |
function my_ap_question_cpt_filter($args){ | |
$args['support'] = 'thumbnail'; | |
return $args; | |
} |
<?php | |
/** | |
* Top users widget class | |
* | |
* Shows top users by reputation | |
* | |
* @link http://anspress.io | |
* @since 1.01 | |
* | |
* @package AskBug |
<?php | |
// If this file is called directly, abort. | |
if ( ! defined( 'WPINC' ) ) { | |
die; | |
} | |
/** | |
* The version 1 endpoint for AnsPress questions. | |
*/ |
<?php | |
/** | |
* Hook to filter comments form. | |
* | |
* @param array $form Comment form | |
*/ | |
add_filter( 'ap_comment_form_fields', function( $form ) { | |
$form['fields']['content']['min_length'] = 1; | |
return $form; |
<?php | |
$args = array( | |
'post__in' => [ 1, 2, 3 ]; | |
); | |
anspress()->questions = new Question_Query( $args ); | |
ap_get_template_part( 'archive' ); |