Skip to content

Coiner Blog

The Crypto Currency revolution is here!

  • Home
  • News
    • Bitcoin
    • Altcoin
    • Blockchain
  • Market Price
    • Bitcoin
    • Ethereum
    • Bitcoin Cash
    • Litecoin
    • Monero
    • MIDAS
    • Decred
    • Dash
  • Invest in Cryptocurrency
    • Midas
    • YObit
    • Bittrex
    • Binance
    • Graviex
    • Crypto Baseball
  • Contact Us
Main Menu
Blockchain

How to Increase Functionality of the Account Page of WP User Frontend | Hacker Noon

September 29, 2020 - by coineradmin

Author profile picture

By default, the account page of WP User Frontend doesn’t show any custom post type posts. The shortcode built page offers to show the default post type post of WordPress. The dashboard page, built with another shortcode [wpuf_dashboard] is the appropriate page to show custom posts because it can accept post type as a parameter.

So how do you show the custom posts on the account page? Simple.

We have to use a bit of custom code block to show a new tab on the account page. Then all we have to do is make the dashboard page action happen in the new tab.

This can help us to show multiple custom post type posts, add more than one “submit post” section or show subscription page directly from account. So let’s see how we can do that.

First, we have to insert the code block that we need to add the tab in our WP-content/themes/child-themes/functions.php file:

add_filter( 'wpuf_account_sections', 'wpuf_custom_tab' );

function wpuf_custom_tab( $sections ) {
$sections = array_merge( $sections, array( array( 'slug' => 'my-page', 'label' => 'Custom Posts' ) ) );

return $sections;
}



add_action( 'wpuf_account_content_my-page', 'wpuf_custom_tab_section', 10, 2 );

function wpuf_custom_tab_section( $sections, $current_section ) {

 echo do_shortcode('[wpuf_dashboard post_type="custom_post_name"]'); 

}

So if you are familiar with coding, you can see in the above code we have used a filter and an action hook and have added the callback functions. In the function wpuf_custom_tab_section, we will add the shortcode which will bring the custom post list/subscription list/custom post forms for us.

Now, let’s say I want to show the WooCommerce product type post. I will modify the value in the post_type and label is always free to take any label you want.

add_filter( 'wpuf_account_sections', 'wpuf_custom_tab' );

function wpuf_custom_tab( $sections ) {
$sections = array_merge( $sections, array( array( 'slug' => 'my-page', 'label' => 'Submit Product' ) ) );

return $sections;
}



add_action( 'wpuf_account_content_my-page', 'wpuf_custom_tab_section', 10, 2 );

function wpuf_custom_tab_section( $sections, $current_section ) {

 echo do_shortcode('[wpuf_dashboard post_type="product"]'); 

}

In the same way, if you add the subscription page shortcode inside the do_shortcode() function, then you can show all the subscription packs available for the user to choose from.

In a similar process, if you insert a form shortcode inside the do_shortcode() function, that form will be available for the users to submit post from the account page.

That’s all folks, hope you found this useful! You can follow me on GitHub and on Twitter.

Share this story

Related

pre-emoji story

pre-emoji story

Tags

The Noonification banner

Subscribe to get your daily round-up of top tech stories!

read original article here

TaggedaccountBycustomdefaultdoesn'tfrontendpagepostshowuser

Related Posts

A World Where Nobody Loses: US and Chinese Tech Monopoly Alternatives | Hacker Noon

January 19, 2021

Why Node.js is Great for Backend Development | Hacker Noon

January 19, 2021

Need a Career Change? 5 Reasons to Transition into Tech in 2021 | Hacker Noon

January 19, 2021

Post navigation

Previous Article The United Kingdom’s New National Data Strategy (Summary and Analysis) | Hacker Noon
Next Article Understanding AngularJS Transclusion Directive | Hacker Noon

About coineradmin

View all posts by coineradmin →
Exchange now
Fixed Rate
You send
BTC
You get
ETH
1 BTC ~ ETHExpected rate
1
Pre step
Exchange now
Fixed Rate
You send
BTC
You get
ETH
1 BTC ~ ETHExpected rate

Please be careful not to provide a smart contract as your payout address

Enter the recipient’s address

+ Add refund addressRemove refund address

Payment ID (optional)

Enter refund address

In case something goes wrong during the exchange, we might need a refund address so we can return your coins back to you

You send
1btc
1 BTC ≈ 53.201195 ETH
You get
≈
0xcC12d027dCe8E5AB896ac64b7811b267
estimated arrival≈ minutes
refund address
destination tag
You send
to address
tx id
You get
to address
destination tag
Awaiting payment
Waiting for exchange
Sent to your wallet
Error during exchange.
Funds for this transaction will be returned to the sender's address or the specified refund address.
Error during exchange.
Please contact support.
Exchange completed.

Recent Posts

  • US crypto regulations will return Bitcoin to its digital cash origins
  • Grayscale holds the key to Bitcoin hitting $40K, says JPMorgan
  • Bible quotation found in Bitcoin block number 666,666
  • ‘Pay attention’ — Grayscale adds 18x the Bitcoin mined supply in one day
  • Trezor crypto wallet warns users of doppelgänger scam app on Google Play

Categories

  • Altcoin
  • Altcoin News
  • Altcoins
  • atlcoin
  • Bitcoin
  • Bitcoin News
  • Blockchain
  • Blockchain News
  • breakingnews
  • Coin Central
  • Cryponews
  • Crypto
  • Crypto News
  • Cryptocurrency
  • Cryptocurrency exchanges
  • Cryptonews
  • crytocurrency
  • ERC20 tokens
  • Exchanges
  • ICO News
  • Market Price
  • News

Archives

  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
Copyright © 2021 Coiner Blog.
Powered by WordPress and HitMag.