Cannot DIsplay a Snackbar Notice on Button Click – Notice is undefined

I am trying to use withSelect and withDispatch to display an admin notice when "save" button is clicked. I am using the following code from this repo but it throws an error: "notices is undefined". Here is the code I am using:

import { Icon, Button, SnackbarList } from '@wordpress/components'; import { dispatch, withSelect, withDispatch } from '@wordpress/data'; import { compose } from '@wordpress/compose'; // Display and Dispatch the notice const NewNotices = ({ notices, removeNotice }) => {          //Uncaught TypeError: notices is undefined     const snackbarNotices = notices.filter((notice) => notice.type === 'snackbar');      return (         <>             <SnackbarList                 className="cwg-admin-notices"                 notices={snackbarNotices}                 onRemove={removeNotice}             />         </>     ); }  export default compose([     withSelect((select) => ({         notices: select('core/notices').getNotices(),     })),     withDispatch((dispatch) => ({         removeNotice: dispatch('core/notices').removeNotice,     })), ])(NewNotices); 
<> //Create the notice on btn click <Button    isPrimary    onClick={() =>    {    settings.save();    dispatch('core/notices')    .createNotice(    'success',    __('Settings Saved', 'slug'),    {    type: 'snackbar',    isDismissible: true,    icon:     <Icon icon="smiley" />    }    );    }}    >    {__('Save', 'slug')} </Button> <NewNotices /> </> 

How to display CellObjects as Cells in PopupWindow

I am attempting to use a celltag ("temp") to display an entire cell in a PopupWindow. To see what I am attempting to do, open a new notebook and evaluate the following:

SetOptions[EvaluationCell[],CellTags->"temp"] 

Now, in a new cell, evaluate the following:

PopupWindow["Click Me", RawBoxes[NotebookRead[Cells[CellTags -> {"temp"}]]],ShowCellBracket -> True] 

The resulting output is a button labeled "Click Me". When you click this button a PopupWindow appears containing the contents of the cell with celltag "temp". My problem is that I am only grabbing the contents of the cell in the PopupWindow and not the entire cell.

I would like the entire cell including the grayed out section to to the right. I turned on the cellbrackets for clarity. It appears I am only grabbing the text. I can’t figure out how to grab the entire cell and display it in the PopupWindow. Any ideas?

BTW… my goal is to create buttons that appear as words in a text cell that when clicked will display a popup containing definitions grabbed from other cells in the notebook.

enter image description here

How to display user_meta array as a table?

Ok, so I’m building a "Transactions" table for a user using user_meta array.

I’m new to this and trying to figure things out.

Basically, in practice I know how to store array to user_meta.

$  the_meta_array = array (     'type' => 'value-1',     'amount' => 'value-2',     'date' => 'value-3',     'method' => 'value-4',     'status' => 'value-5', );   $  user_id = 12345;   $  user_meta_key = 'transactions';   add_user_meta( $  user_id, $  user_meta_key, $  the_meta_array ); 

My question is how to display ‘transactions’ meta_key for that specific user in a table format like this:

----------------------------------------------------- type    | amount  | date          | method | status ----------------------------------------------------- deposit | $  15     | 2021,09,18    | Paypal | done ----------------------------------------------------- deposit | $  35     | 2021,09,14    | Paypal | done ----------------------------------------------------- cashout | $  25     | 2021,09,11    | Paypal | done 

Is it possible to display meta_key array as a loop?

Have no idea how practically do this.

I know it should be possible somehow.

Any help would be very appreciated.

Get Array data and display, this code functions good, but why, and is it proper?

I wrote this code to use when ‘getting’ database data that was saved in wp custom wp options. I really don’t understand what the code is doing completely so if you can explain it please. And also tell me if it’s even proper code or if I should use different code. The reason I first started using the code is when I tried to get the data from the database data is in an Array and trying to display the data with just the first $ name gives a php/array error, so for example echo $ name gives error; so if I use the code and display for example echo $ thename, this functions good without error. I also use the normal get option code to get the data like this: $ name = get_option(‘custom_name’); … the main question is about the code below:

if (!empty($  name)) :  foreach($  name as $  thename)  {   $  name = $  thename;  } endif; 

I don’t know why it works or if it’s proper to use for getting data with get_option.

Please write me any comments or improvements so I learn and my code is more proper.

How to make a custom category archive page display names for each of terms when displaying a page showing more than one

I have a custom page for a specific custom category which was derived from archive.php. On this page I have a "Search and Filter" (plugin) set of checkboxes which allows for a selection of one or more categories and the results are then displayed. This all works well.

I’m using a custom category (added with Pods) called "rk_themes" and labelled as "Themes".

I need to show the term names that were selected in a status line along with the number of results. It should show “10 works found for Category Name A, Category Name B”.

The URL for this is like https://example.net/theme/category-name-a+category-name-b

Showing the count is easy enough, but I can’t figure out how to access the term names. A var_dump of WP_Query suggests there is only a label for the first term.

Custom post ID & display information related to this ID

I’m new to WordPress and I want users to be able to retrieve a post by its ID.

For that I will be using a form in the homepage asking an ID and submitting the form will redirect user to the post’s URL.

I see that as 2 steps:

  1. use dynamic permalinks
  2. display post information based on the ID (I am using CPT UI and ACF)

For step 1, I went to wp-admin/options-permalink and set it to "simple > http://.com/?p=123". Hopefully it’s the good way, correct?

For step 2, how can I retrieve the ID from the URL and display the informations related to a particular post?

  • should I edit a particular page like posts.php?
  • how to edit this page? FTP or add-on?
  • is there a way to do such thing from the UI directly?

THE USE, FUNCTIONS AND ADVANTAGES OF CARDBOARD DISPLAY STAND

The use, functions and advantages of the cardboard display stand
In addition to the traditional shelf and display stand functions, paper shelves and display stands have the following features:
The appearance of the cardboard display stand can be printed in color, which is an excellent advertising carrier;
The cardboard display stands are all (or mainly) printed paper and high-hardness paperboard, which are sufficient to carry promotional items and meet strict environmental requirements;
Applicable to all kinds of large-scale promotional activities, stores, shopping malls, exhibitions, etc. The patterns, colors and shapes can be freely and innovatively designed, and the publicity effect is excellent;
Light weight, can be stacked flat, saving transportation logistics costs, can be used repeatedly;
Economical and extremely practical, the seller has finished using it. If it is improved due to factors such as the appearance of the product, it is convenient to dispose of the recycling department.
Different paper materials can be selected according to the requirements of customers and carriers, and can be combined with other materials (metal, wood, plastic, etc.) to form a mixed structure display stand;
Convenient supplier to ship directly from the place of origin to the final point of sale to unpack and sell, saving the cost of repeated stacking and packaging
The paper shelf/cardboard display stand has high economic value, and it has the function of attracting customers and promoting goods for any business form of business form. At the same time, it has the effect of improving the image of the product and the visibility of the company. The paper shelf/cardboard display stand mainly has the following functions:
New product notification
Most paper shelves/cardboard pallet displays are advertising advertisements for new products. When new products are sold, in conjunction with other publicity media, the use of paper shelves/cardboard display stands for sales promotion at the sales location can attract consumers’ attention and stimulate their desire to purchase.
Attract customers into the store
Two-thirds of the actual purchases are made on a temporary basis, and it is clear that retail sales are directly proportional to their customer traffic. Therefore, the first step in the promotion of paper shelf/cardboard floor displays is to attract people to the store.
Lead customers to stop
How to attract customers to pay attention to the goods and attract interest, the paper shelf/cardboard display stand can attract customers’ attention with its novel patterns, beautiful colors, unique ideas and other forms, so that it stops to stay and then has an interest in the products in the advertisement. Ingenious, eye-catching paper shelves/cardboard displays often have unexpected effects. In addition, live advertising, such as on-site operation, trial samples, and free tasting, can also greatly motivate customers’ interests and induce purchase motives.
Promote final purchase
Inspiring customers to make the final purchase is the core function of the paper shelf/cardboard display. To this end, we must seize the customer’s concerns and excitement. In fact, the previous induction work is the basis for the customer’s final purchase. The customer’s purchase decision is a process. As long as the promotion work in the process is completed, the result will naturally occur.
Replace salesperson
The paper shelf/cardboard display stand has the reputation of “silent salesman” and “most faithful salesman”. The environment often used by paper boxes/paper shelves/cardboard hook displays is a supermarket, and the supermarket is a self-selected purchase method. In the supermarket, when the consumer faces many products and cannot start, an outstanding paper shelf placed around the goods/ cardboard display stands to provide merchandise information to consumers faithfully and continuously, and to play a role in attracting consumers and making their purchase decisions.
Create a sales atmosphere
Using paper shelves/cardboard display stands with strong colors, beautiful patterns, outstanding shapes, humorous movements, accurate and vivid advertising language, you can create a strong sales atmosphere, attract consumers’ attention and make purchase impulses.
Enhance corporate image
The paper shelf/cardboard display stand, like other advertisements, can play a role in establishing and enhancing the corporate image in the sales environment, thereby maintaining a good relationship with consumers. Paper shelf/cardboard display stand is an important part of corporate visual identity. Retail companies can make store logos, standard characters, standard colors, corporate image patterns, promotional slogans, slogans, etc. into various forms of paper shelves/cardboard display stands to create a distinctive corporate image.
Holiday promotion
Paper shelves/cardboard displays are an important means of matching holiday promotions. In a variety of traditional and modern festivals, paper shelves/cardboard displays can create a happy atmosphere. The paper shelf/cardboard display rack has played a role in fueling the holiday season.
 

Allow users to upload and display multiple photos

So basically I have a social website and I want for WordPress users to be able to upload pictures and display them on their front end profile page.

I have been looking into the user submitted galleries, but all of them put user pictures into one gallery.

I need them to be similar to facebook, where each user’s uploaded photos will be displayed only on their profile pages.

And only them could upload/edit/delete their photos.

I know it may take a lot of time to code this, but if anyone have a piece of code, or can suggest a plugin that does this, I would gladly appreciate.